Class CrowdWebTestCase
java.lang.Object
com.atlassian.crowd.acceptance.tests.applications.crowd.CrowdWebDriverTest
com.atlassian.crowd.acceptance.utils.CrowdWebTestCase
- Direct Known Subclasses:
ApplicationAcceptanceTestCase
,CrowdAcceptanceTestCase
Base Crowd test case, with extra assertions on top of
CrowdWebDriverTest
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
class
-
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequestHeader
(String header, String value) Adds a request header for all subsequent requests.void
assertButtonNotPresent
(String buttonId) void
assertCheckboxNotPresent
(String checkBoxName) void
assertCheckboxNotSelected
(String checkBoxName) void
assertCheckboxPresent
(String checkBoxName) void
assertCheckboxSelected
(String checkBoxName) void
assertCheckboxSelected
(String checkBoxName, boolean value) void
assertElementIsDisabled
(String elementID) Assert that a given element's disabled attribute is set with value = 'disabled'.void
assertElementIsEnabled
(String elementID) Assert that a given element's disabled attribute is not present.void
void
void
assertElementPresent
(String anID) void
void
Makes sure the page does not contain an error, as when an exception has occurred.void
Makes sure the page does contain an error, as when an exception has occurred.void
assertErrorPresentWithKey
(String keyName) Makes sure the page does contain an error and that it also contains the text of the key.void
assertFieldErrorPresentWithKey
(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.void
Makes sure the page contains an info boxvoid
assertKeyInElement
(String elementID, String key) Assert that a given element contains a specific web resource's value.void
void
assertKeyPresent
(String key) Assert that a web resource's value is present.void
assertKeyPresent
(String key, String... args) void
assertKeyPresent
(String key, List<String> args) Assert that a web resource's value is present.void
assertLinkNotPresent
(String linkId) void
assertLinkPresent
(String linkId) void
assertLinkPresentWithKey
(String keyName) Assert that a link containing the text of the key is present.void
assertMatchInTable
(String id, String regexp) void
assertRadioOptionNotPresent
(String name, String radioOption) void
assertRadioOptionSelected
(String radioGroup, String radioOption) void
assertSelectedOptionEquals
(String selectName, String optionLabel) void
assertSelectedOptionValueEquals
(String selectName, String value) void
assertSelectOptionsEqual
(String selectName, String[] optionLabels) void
Makes sure the page contains a success messagevoid
void
void
assertTableRowCountEquals
(String id, int expectedRowCount) void
assertTextFieldEquals
(String formElementName, String expectedValue) void
assertTextInElement
(String elementId, String text) void
assertTextInTable
(String id, String text) void
assertTextInTable
(String id, String[] text) void
assertTextNotInTable
(String id, String text) void
assertTextNotInTable
(String id, String[] text) void
assertTextNotPresent
(String text) void
assertTextPresent
(String text) Assert that supplied text is present.void
assertTitleEquals
(String expectedTitle) void
assertTitleMatch
(String regexp) void
assertTitleNotEquals
(String title) void
void
Makes sure the page doesn't contain a warning, as when an exception has occurred.void
void
checkCheckbox
(String checkBoxName) void
checkCheckbox
(String checkBoxName, boolean value) void
void
clickButton
(String buttonId) void
clickButtonWithText
(String buttonValueText) void
clickElementByXPath
(String xpath) void
void
clickLinkInNavbar
(String linkId) void
clickLinkInNavbarDropdown
(String linkId) void
clickLinkWithExactText
(String linkText) void
clickLinkWithKey
(String key) Clicks a linkvoid
clickLinkWithText
(String linkText) void
clickRadioOption
(String radioGroup, String radioOption) void
protected void
protected static org.hamcrest.Matcher<String>
OverrideIsEqualCompressingWhiteSpace
and also ignore no-break space.protected io.atlassian.fugue.Option<com.atlassian.pageobjects.elements.PageElement>
findElementWithText
(String tagName, String text) com.atlassian.pageobjects.elements.PageElement
getElementById
(String id) com.atlassian.pageobjects.elements.PageElement
getElementByXPath
(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.PageElementFinder
com.atlassian.pageobjects.elements.PageElement
getLinkInNavbar
(String linkId) com.atlassian.pageobjects.elements.PageElement
getLinkInNavbarDropdown
(String linkId) getMessage
(String key) getMessage
(String key, String... args) getName()
protected String
protected com.atlassian.webdriver.utils.element.WebDriverPoller
protected List<com.atlassian.pageobjects.elements.PageElement>
getRadiosFromRadioGroup
(String radioGroup) protected static com.atlassian.pageobjects.elements.PageElement
getRadioWithValue
(List<com.atlassian.pageobjects.elements.PageElement> elements, String radioOption) protected io.restassured.http.Cookies
protected String
protected com.google.common.collect.ImmutableList<String>
getTextForList
(String... keys) void
boolean
boolean
isTextPresent
(String text) Checks if text is present on the pageprotected void
protected <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) void
selectOption
(String selectName, int index, String label) void
selectOption
(String selectName, String label) void
selectOptionBy
(org.openqa.selenium.By selectSelector, String label) void
selectOptionByValue
(String selectName, String value) static io.restassured.http.Cookie
seleniumCookieToRestAssuredCookie
(org.openqa.selenium.Cookie c) void
setRadioButton
(String radioButtonName, String value) Sets a specific radio button.protected void
setResourceBundleName
(String resourceBundleName) void
setTextField
(String inputName, String value) void
setUp()
void
setWorkingForm
(int index) void
setWorkingForm
(String formName) void
submit()
void
void
uncheckCheckbox
(String checkboxName) com.atlassian.pageobjects.elements.PageElement
protected void
Methods inherited from class com.atlassian.crowd.acceptance.tests.applications.crowd.CrowdWebDriverTest
assertAtRelativePath, assertAtURIContaining, assertAtURIEndingWith, assertAtUrl, assertHasError, assertHasErrorKey, 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:
setUp
in 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
OverrideIsEqualCompressingWhiteSpace
and 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
-