Class CrowdWebTestCase
java.lang.Object
com.atlassian.crowd.acceptance.tests.applications.crowd.CrowdWebDriverTest
com.atlassian.crowd.acceptance.utils.CrowdWebTestCase
- Direct Known Subclasses:
ApplicationAcceptanceTestCase,CrowdAcceptanceTestCase,StrutsPluginModuleTest
Base Crowd test case, with extra assertions on top of
CrowdWebDriverTest.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classclass -
Field Summary
Fields inherited from class com.atlassian.crowd.acceptance.tests.applications.crowd.CrowdWebDriverTest
applinksClient, BACKUP_RESOURCE, BATCHED_TEST_RULE, COOKIE_ABSENT, i18n, IMMUTABLE_USER_NAME, IMMUTABLE_USER_PW, JSESSIONID_COOKIE, log, REMEMBER_ME_COOKIE, restAdminClient, SSO_COOKIE, TEST_USER_DISPLAYNAME, TEST_USER_NAME, TEST_USER_PW, testedProduct, testkitClient, webDriverRules -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequestHeader(String header, String value) Adds a request header for all subsequent requests.voidassertButtonNotPresent(String buttonId) voidassertCheckboxNotPresent(String checkBoxName) voidassertCheckboxNotSelected(String checkBoxName) voidassertCheckboxPresent(String checkBoxName) voidassertCheckboxSelected(String checkBoxName) voidassertCheckboxSelected(String checkBoxName, boolean value) voidassertElementIsDisabled(String elementID) Assert that a given element's disabled attribute is set with value = 'disabled'.voidassertElementIsEnabled(String elementID) Assert that a given element's disabled attribute is not present.voidvoidvoidassertElementPresent(String anID) voidvoidMakes sure the page does not contain an error, as when an exception has occurred.voidMakes sure the page does contain an error, as when an exception has occurred.voidassertErrorPresentWithKey(String keyName) Makes sure the page does contain an error and that it also contains the text of the key.voidassertFieldErrorPresentWithKey(String keyName) Makes sure the page does contain a field error that contains the text of the key, as when a validation error occurs in a form.voidMakes sure the page contains an info boxvoidassertKeyInElement(String elementID, String key) Assert that a given element contains a specific web resource's value.voidvoidassertKeyPresent(String key) Assert that a web resource's value is present.voidassertKeyPresent(String key, String... args) voidassertKeyPresent(String key, List<String> args) Assert that a web resource's value is present.voidassertLinkNotPresent(String linkId) voidassertLinkPresent(String linkId) voidassertLinkPresentWithKey(String keyName) Assert that a link containing the text of the key is present.voidassertMatchInTable(String id, String regexp) voidassertRadioOptionNotPresent(String name, String radioOption) voidassertRadioOptionSelected(String radioGroup, String radioOption) voidassertSelectedOptionEquals(String selectName, String optionLabel) voidassertSelectedOptionValueEquals(String selectName, String value) voidassertSelectOptionsEqual(String selectName, String[] optionLabels) voidMakes sure the page contains a success messagevoidvoidvoidassertTableRowCountEquals(String id, int expectedRowCount) voidassertTextFieldEquals(String formElementName, String expectedValue) voidassertTextInElement(String elementId, String text) voidassertTextInTable(String id, String text) voidassertTextInTable(String id, String[] text) voidassertTextNotInTable(String id, String text) voidassertTextNotInTable(String id, String[] text) voidassertTextNotPresent(String text) voidassertTextPresent(String text) Assert that supplied text is present.voidassertTitleEquals(String expectedTitle) voidassertTitleMatch(String regexp) voidassertTitleNotEquals(String title) voidvoidMakes sure the page doesn't contain a warning, as when an exception has occurred.voidvoidcheckCheckbox(String checkBoxName) voidcheckCheckbox(String checkBoxName, boolean value) voidvoidclickButton(String buttonId) voidclickButtonWithText(String buttonValueText) voidclickElementByXPath(String xpath) voidvoidclickLinkInNavbar(String linkId) voidclickLinkInNavbarDropdown(String linkId) voidclickLinkWithExactText(String linkText) voidclickLinkWithKey(String key) Clicks a linkvoidclickLinkWithText(String linkText) voidclickRadioOption(String radioGroup, String radioOption) voidprotected voidprotected static org.hamcrest.Matcher<String>OverrideIsEqualCompressingWhiteSpaceand also ignore no-break space.protected io.atlassian.fugue.Option<com.atlassian.pageobjects.elements.PageElement>findElementWithText(String tagName, String text) com.atlassian.pageobjects.elements.PageElementgetElementById(String id) com.atlassian.pageobjects.elements.PageElementgetElementByXPath(String xPath) List<com.atlassian.pageobjects.elements.PageElement>getElementsByXPath(String xPath) getElementTextById(String elementId) getElementTextByXPath(String xpath) getElementValueByID(String elementID) Returns the content of the 'value' attribute of an element, given the element idprotected com.atlassian.pageobjects.elements.PageElementFindercom.atlassian.pageobjects.elements.PageElementgetLinkInNavbar(String linkId) com.atlassian.pageobjects.elements.PageElementgetLinkInNavbarDropdown(String linkId) getMessage(String key) getMessage(String key, String... args) getName()protected Stringprotected com.atlassian.webdriver.utils.element.WebDriverPollerprotected List<com.atlassian.pageobjects.elements.PageElement>getRadiosFromRadioGroup(String radioGroup) protected static com.atlassian.pageobjects.elements.PageElementgetRadioWithValue(List<com.atlassian.pageobjects.elements.PageElement> elements, String radioOption) protected io.restassured.http.Cookiesprotected Stringprotected com.google.common.collect.ImmutableList<String>getTextForList(String... keys) voidbooleanbooleanisTextPresent(String text) Checks if text is present on the pageprotected voidprotected <T> List<T>scrapeTable(String id, com.google.common.base.Function<List<String>, T> mapper) protected <T> List<T>scrapeTable(String id, List<String> headings, com.google.common.base.Function<List<String>, T> mapper) protected <T> List<T>scrapeTable(String id, List<String> headings, com.google.common.base.Function<List<String>, T> mapper, boolean hasFooter) voidselectOption(String selectName, int index, String label) voidselectOption(String selectName, String label) voidselectOptionBy(org.openqa.selenium.By selectSelector, String label) voidselectOptionByValue(String selectName, String value) static io.restassured.http.CookieseleniumCookieToRestAssuredCookie(org.openqa.selenium.Cookie c) voidsetRadioButton(String radioButtonName, String value) Sets a specific radio button.protected voidsetResourceBundleName(String resourceBundleName) voidsetTextField(String inputName, String value) voidsetUp()voidsetWorkingForm(int index) voidsetWorkingForm(String formName) voidsubmit()voidvoiduncheckCheckbox(String checkboxName) com.atlassian.pageobjects.elements.PageElementprotected voidMethods inherited from class com.atlassian.crowd.acceptance.tests.applications.crowd.CrowdWebDriverTest
assertAtRelativePath, assertAtURIContaining, assertAtURIEndingWith, assertAtUrl, assertHasError, assertHasErrorKey, beforeCreatingTestedProduct, bind, bind, clearAndInvalidateSsoCookieIfPresent, clearAndInvalidateSsoCookieOrFail, deleteAllCookies, deleteCookie, expectState, getBaseUrl, getBaseUrlWithoutPort, getCookie, getCookieOrThrow, getCurrentUrl, getDriver, getSsoCookieOrFail, getTestkitClient, hasCookie, hasSsoCookie, intendToModifyLdapData, loginAsExpiredPasswordUser, loginAsNonAdmin, loginAsNonAdmin, loginAsSysAdmin, loginAsSysAdmin, loginAsSysAdminWithRememberMe, loginAsUser, loginExpectingFailure, loginImmutableUser, loginImmutableUser, loginTestUser, loginTestUser, logout, manage, navigateToAndBind, navigateToUrl, restoreBaseSetup, restoreCrowdFromXML, restoreCrowdFromXML, waitForUrl, waitUntilAsyncFinished
-
Constructor Details
-
CrowdWebTestCase
public CrowdWebTestCase()
-
-
Method Details
-
seleniumCookieToRestAssuredCookie
public static io.restassured.http.Cookie seleniumCookieToRestAssuredCookie(org.openqa.selenium.Cookie c) -
setUp
- Overrides:
setUpin classCrowdWebDriverTest- Throws:
Exception
-
assertKeyPresent
Assert that a web resource's value is present.- Parameters:
key- web resource name
-
assertKeyPresent
Assert that a web resource's value is present.- Parameters:
key- web resource name
-
assertKeyPresent
-
assertTextNotPresent
-
assertTextPresent
Assert that supplied text is present. -
assertSuccessPresent
public void assertSuccessPresent()Makes sure the page contains a success message -
assertWarningNotPresent
public void assertWarningNotPresent()Makes sure the page doesn't contain a warning, as when an exception has occurred. -
assertErrorNotPresent
public void assertErrorNotPresent()Makes sure the page does not contain an error, as when an exception has occurred. -
assertWarningAndErrorNotPresent
public void assertWarningAndErrorNotPresent() -
assertErrorPresent
public void assertErrorPresent()Makes sure the page does contain an error, as when an exception has occurred. -
assertErrorPresentWithKey
Makes sure the page does contain an error and that it also contains the text of the key. Note: it does not (yet) verify that the text is within the error. -
assertFieldErrorPresentWithKey
Makes sure the page does contain a field error that contains the text of the key, as when a validation error occurs in a form. -
assertInfoPresent
public void assertInfoPresent()Makes sure the page contains an info box -
assertLinkPresentWithKey
Assert that a link containing the text of the key is present.- Parameters:
keyName- The key whose associated text will be searched for.
-
assertKeyInElement
Assert that a given element contains a specific web resource's value.- Parameters:
elementID- id of element to be inspectedkey- the web resource's key
-
assertElementIsDisabled
Assert that a given element's disabled attribute is set with value = 'disabled'. Assertion will fail if any of the below conditions are met- Cannot find the target element using the given elementID
- The attribute is not set in the element to be inspected
- The value of the attribute is not 'disabled'
- Parameters:
elementID- id of element to be inspected
-
assertElementIsEnabled
Assert that a given element's disabled attribute is not present. Assertion will fail if any of the below conditions are met- Cannot find the target element using the given elementID
- The attribute is not set in the element to be inspected
- The value of the attribute is not 'disabled'
- Parameters:
elementID- id of element to be inspected
-
getElementValueByID
Returns the content of the 'value' attribute of an element, given the element id- Parameters:
elementID- the id of the element we are looking for
-
setRadioButton
Sets a specific radio button.- Parameters:
radioButtonName- The name of the radio button.value- The value to set it too.
-
clickLinkWithKey
Clicks a link- Parameters:
key- The value of this key is the link clicked
-
getElementTextById
-
addRequestHeader
Adds a request header for all subsequent requests.- Parameters:
header- header paramater.value- parameter value.
-
assertElementPresentByXPath
-
getPageSource
-
clickButtonWithText
-
assertElementNotPresentByXPath
-
clickRadioOption
-
assertRadioOptionSelected
-
assertTextNotInTable
-
assertTitleEquals
-
assertTitleNotEquals
-
assertLinkPresent
-
isElementWithIdPresent
-
getRestAssuredCookies
protected io.restassured.http.Cookies getRestAssuredCookies() -
getBaseUrlIPv6
-
log
-
getPageText
-
assertTextInTable
-
waitForElementById
-
setTextField
-
selectOption
-
selectOptionBy
-
submit
public void submit() -
clickLinkWithExactText
-
findElementWithText
-
checkCheckbox
-
checkCheckbox
-
assertTextFieldEquals
-
clickLink
-
clickButton
-
assertTableRowCountEquals
-
assertTableNotPresent
-
selectOptionByValue
-
assertSelectedOptionEquals
-
assertSelectOptionsEqual
-
clickLinkWithText
-
assertTextInElement
-
assertCheckboxPresent
-
assertCheckboxNotSelected
-
getElementsByXPath
-
assertTitleMatch
-
getMessage
-
getMessage
-
getElementByXPath
-
clickElementByXPath
-
uncheckCheckbox
-
assertElementNotPresent
-
assertButtonNotPresent
-
assertSelectedOptionValueEquals
-
assertCheckboxSelected
-
assertCheckboxSelected
-
assertCheckboxNotPresent
-
assertKeyNotPresent
-
getElementById
-
assertRadioOptionNotPresent
-
getElementTextByXPath
-
submit
-
gotoPage
-
assertTextInTable
-
assertElementPresent
-
assertTablePresent
-
assertLinkNotPresent
-
closeBrowser
public void closeBrowser() -
selectOption
-
setWorkingForm
public void setWorkingForm(int index) -
setWorkingForm
-
assertTextNotInTable
-
assertMatchInTable
-
getTestContext
-
beginAt
-
getName
-
isTextPresent
Checks if text is present on the page- Parameters:
text- the text to match for- Returns:
- true if the text is found. false otherwise
-
scrapeTable
-
scrapeTable
-
scrapeTable
-
getTable
-
equalToIgnoringWhiteSpace
OverrideIsEqualCompressingWhiteSpaceand also ignore no-break space. -
getText
-
clearCookies
public void clearCookies() -
getTextForList
-
getFinder
protected com.atlassian.pageobjects.elements.PageElementFinder getFinder() -
getPoller
protected com.atlassian.webdriver.utils.element.WebDriverPoller getPoller() -
setResourceBundleName
-
disableIpAddressValidation
protected void disableIpAddressValidation() -
waitUntilPageLoad
protected void waitUntilPageLoad() -
getRadioWithValue
-
getRadiosFromRadioGroup
-