public class CrowdWebTestCase extends CrowdWebDriverTest
CrowdWebDriverTest
.Modifier and Type | Class and Description |
---|---|
static class |
CrowdWebTestCase.GenericPage |
class |
CrowdWebTestCase.TestContext |
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 and Description |
---|
CrowdWebTestCase() |
Modifier and Type | Method and Description |
---|---|
void |
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 |
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 |
assertElementNotPresent(String anID) |
void |
assertElementNotPresentByXPath(String xpath) |
void |
assertElementPresent(String anID) |
void |
assertElementPresentByXPath(String xpath) |
void |
assertErrorNotPresent()
Makes sure the page does not contain an error, as when an exception has occurred.
|
void |
assertErrorPresent()
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 |
assertInfoPresent()
Makes sure the page contains an info box
|
void |
assertKeyInElement(String elementID,
String key)
Assert that a given element contains a specific web resource's value.
|
void |
assertKeyNotPresent(String key) |
void |
assertKeyPresent(String key)
Assert that a web resource's value is present.
|
void |
assertKeyPresent(String key,
List<String> args)
Assert that a web resource's value is present.
|
void |
assertKeyPresent(String key,
String... args) |
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 |
assertSelectedOptionEquals(String selectName,
String optionLabel) |
void |
assertSelectedOptionValueEquals(String selectName,
String value) |
void |
assertSelectOptionsEqual(String selectName,
String[] optionLabels) |
void |
assertSuccessPresent()
Makes sure the page contains a success message
|
void |
assertTableNotPresent(String id) |
void |
assertTablePresent(String id) |
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 |
assertWarningAndErrorNotPresent() |
void |
assertWarningNotPresent()
Makes sure the page doesn't contain a warning, as when an exception has occurred.
|
void |
beginAt(String url) |
void |
checkCheckbox(String checkBoxName) |
void |
checkCheckbox(String checkBoxName,
boolean value) |
void |
clearCookies() |
void |
clickButton(String buttonId) |
void |
clickButtonWithText(String buttonValueText) |
void |
clickElementByXPath(String xpath) |
void |
clickLink(String linkId) |
void |
clickLinkInNavbar(String linkId) |
void |
clickLinkWithExactText(String linkText) |
void |
clickLinkWithKey(String key)
Clicks a link
|
void |
clickLinkWithText(String linkText) |
void |
clickRadioOption(String radioGroup,
String radioOption) |
void |
closeBrowser() |
protected void |
disableIpAddressValidation() |
protected static org.hamcrest.Matcher<String> |
equalToIgnoringWhiteSpace(String s)
Override
IsEqualIgnoringWhiteSpace and also ignore no-break space. |
protected io.atlassian.fugue.Option<com.atlassian.pageobjects.elements.PageElement> |
findElementWithText(String tagName,
String text) |
String |
getBaseUrlIPv6() |
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) |
String |
getElementTextById(String elementId) |
String |
getElementTextByXPath(String xpath) |
String |
getElementValueByID(String elementID)
Returns the content of the 'value' attribute of an element, given the element id
|
protected com.atlassian.pageobjects.elements.PageElementFinder |
getFinder() |
String |
getMessage(String key) |
String |
getMessage(String key,
String... args) |
String |
getName() |
String |
getPageSource() |
protected String |
getPageText() |
protected com.atlassian.webdriver.utils.element.WebDriverPoller |
getPoller() |
protected io.restassured.http.Cookies |
getRestAssuredCookies() |
protected List<List<String>> |
getTable(String id) |
CrowdWebTestCase.TestContext |
getTestContext() |
protected String |
getText(String key) |
protected com.google.common.collect.ImmutableList<String> |
getTextForList(String... keys) |
void |
gotoPage(String url) |
boolean |
isElementWithIdPresent(String id) |
boolean |
isTextPresent(String text)
Checks if text is present on the page
|
protected void |
log(String message) |
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 |
submit(String buttonName) |
void |
uncheckCheckbox(String checkboxName) |
com.atlassian.pageobjects.elements.PageElement |
waitForElementById(String id) |
protected void |
waitUntilPageLoad() |
assertAtRelativePath, assertAtURIContaining, assertAtURIEndingWith, assertAtUrl, assertHasError, assertHasErrorKey, bind, bind, clearAndInvalidateSsoCookieIfPresent, clearAndInvalidateSsoCookieOrFail, deleteAllCookies, deleteCookie, getBaseUrl, getBaseUrlWithoutPort, getCookie, getCookieOrThrow, getCurrentUrl, getDriver, getSsoCookieOrFail, getTestkitClient, hasCookie, hasSsoCookie, intendToModifyData, intendToModifyLdapData, loginAsExpiredPasswordUser, loginAsNonAdmin, loginAsNonAdmin, loginAsSysAdmin, loginAsSysAdmin, loginAsSysAdminWithRememberMe, loginAsUser, loginExpectingFailure, loginImmutableUser, loginImmutableUser, loginTestUser, loginTestUser, logout, manage, navigateToAndBind, navigateToUrl, restoreBaseSetup, restoreCrowdFromXML, waitForUrl, waitUntilAsyncFinished
public static io.restassured.http.Cookie seleniumCookieToRestAssuredCookie(org.openqa.selenium.Cookie c)
public void setUp() throws Exception
setUp
in class CrowdWebDriverTest
Exception
public void assertKeyPresent(String key)
key
- web resource namepublic void assertKeyPresent(String key, List<String> args)
key
- web resource namepublic void assertTextNotPresent(String text)
public void assertTextPresent(String text)
public void assertSuccessPresent()
public void assertWarningNotPresent()
public void assertErrorNotPresent()
public void assertWarningAndErrorNotPresent()
assertWarningNotPresent()
,
assertErrorNotPresent()
public void assertErrorPresent()
public void assertErrorPresentWithKey(String keyName)
public void assertFieldErrorPresentWithKey(String keyName)
public void assertInfoPresent()
public void assertLinkPresentWithKey(String keyName)
keyName
- The key whose associated text will be searched for.public void assertKeyInElement(String elementID, String key)
elementID
- id of element to be inspectedkey
- the web resource's keypublic void assertElementIsDisabled(String elementID)
elementID
- id of element to be inspectedpublic void assertElementIsEnabled(String elementID)
elementID
- id of element to be inspectedpublic String getElementValueByID(String elementID)
elementID
- the id of the element we are looking forpublic void setRadioButton(String radioButtonName, String value)
radioButtonName
- The name of the radio button.value
- The value to set it too.public void clickLinkWithKey(String key)
key
- The value of this key is the link clickedpublic void addRequestHeader(String header, String value)
header
- header paramater.value
- parameter value.public void assertElementPresentByXPath(String xpath)
public String getPageSource()
public void clickButtonWithText(String buttonValueText)
public void assertElementNotPresentByXPath(String xpath)
public void assertTitleEquals(String expectedTitle)
public void assertTitleNotEquals(String title)
public void assertLinkPresent(String linkId)
public boolean isElementWithIdPresent(String id)
protected io.restassured.http.Cookies getRestAssuredCookies()
public String getBaseUrlIPv6()
protected void log(String message)
protected String getPageText()
public com.atlassian.pageobjects.elements.PageElement waitForElementById(String id)
public void selectOptionBy(org.openqa.selenium.By selectSelector, String label)
public void submit()
public void clickLinkWithExactText(String linkText)
protected io.atlassian.fugue.Option<com.atlassian.pageobjects.elements.PageElement> findElementWithText(String tagName, String text)
public void checkCheckbox(String checkBoxName)
public void checkCheckbox(String checkBoxName, boolean value)
public void assertTextFieldEquals(String formElementName, String expectedValue)
public void clickLink(String linkId)
public void clickLinkInNavbar(String linkId)
public void clickButton(String buttonId)
public void assertTableRowCountEquals(String id, int expectedRowCount)
public void assertTableNotPresent(String id)
public void assertSelectedOptionEquals(String selectName, String optionLabel)
public void assertSelectOptionsEqual(String selectName, String[] optionLabels)
public void clickLinkWithText(String linkText)
public void assertCheckboxPresent(String checkBoxName)
public void assertCheckboxNotSelected(String checkBoxName)
public List<com.atlassian.pageobjects.elements.PageElement> getElementsByXPath(String xPath)
public void assertTitleMatch(String regexp)
public com.atlassian.pageobjects.elements.PageElement getElementByXPath(String xPath)
public void clickElementByXPath(String xpath)
public void uncheckCheckbox(String checkboxName)
public void assertElementNotPresent(String anID)
public void assertButtonNotPresent(String buttonId)
public void assertSelectedOptionValueEquals(String selectName, String value)
public void assertCheckboxSelected(String checkBoxName)
public void assertCheckboxNotPresent(String checkBoxName)
public void assertKeyNotPresent(String key)
public com.atlassian.pageobjects.elements.PageElement getElementById(String id)
public void assertRadioOptionNotPresent(String name, String radioOption)
public void submit(String buttonName)
public void gotoPage(String url)
public void assertElementPresent(String anID)
public void assertTablePresent(String id)
public void assertLinkNotPresent(String linkId)
public void closeBrowser()
public void setWorkingForm(int index)
public void setWorkingForm(String formName)
public CrowdWebTestCase.TestContext getTestContext()
public void beginAt(String url)
public String getName()
public boolean isTextPresent(String text)
text
- the text to match forprotected <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)
protected static org.hamcrest.Matcher<String> equalToIgnoringWhiteSpace(String s)
IsEqualIgnoringWhiteSpace
and also ignore no-break space.public void clearCookies()
protected com.google.common.collect.ImmutableList<String> getTextForList(String... keys)
protected com.atlassian.pageobjects.elements.PageElementFinder getFinder()
protected com.atlassian.webdriver.utils.element.WebDriverPoller getPoller()
protected void setResourceBundleName(String resourceBundleName)
protected void disableIpAddressValidation()
protected void waitUntilPageLoad()
Copyright © 2021 Atlassian. All rights reserved.