Class CrowdWebTestCase

Direct Known Subclasses:
ApplicationAcceptanceTestCase, CrowdAcceptanceTestCase

public class CrowdWebTestCase extends CrowdWebDriverTest
Base Crowd test case, with extra assertions on top of CrowdWebDriverTest.
  • Constructor Details

    • CrowdWebTestCase

      public CrowdWebTestCase()
  • Method Details

    • seleniumCookieToRestAssuredCookie

      public static io.restassured.http.Cookie seleniumCookieToRestAssuredCookie(org.openqa.selenium.Cookie c)
    • setUp

      public void setUp() throws Exception
      Overrides:
      setUp in class CrowdWebDriverTest
      Throws:
      Exception
    • assertKeyPresent

      public void assertKeyPresent(String key)
      Assert that a web resource's value is present.
      Parameters:
      key - web resource name
    • assertKeyPresent

      public void assertKeyPresent(String key, List<String> args)
      Assert that a web resource's value is present.
      Parameters:
      key - web resource name
    • assertKeyPresent

      public void assertKeyPresent(String key, String... args)
    • assertTextNotPresent

      public void assertTextNotPresent(String text)
    • assertTextPresent

      public void assertTextPresent(String text)
      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()
      See Also:
    • assertErrorPresent

      public void assertErrorPresent()
      Makes sure the page does contain an error, as when an exception has occurred.
    • assertErrorPresentWithKey

      public void assertErrorPresentWithKey(String keyName)
      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

      public 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.
    • assertInfoPresent

      public void assertInfoPresent()
      Makes sure the page contains an info box
    • assertLinkPresentWithKey

      public void assertLinkPresentWithKey(String keyName)
      Assert that a link containing the text of the key is present.
      Parameters:
      keyName - The key whose associated text will be searched for.
    • assertKeyInElement

      public void assertKeyInElement(String elementID, String key)
      Assert that a given element contains a specific web resource's value.
      Parameters:
      elementID - id of element to be inspected
      key - the web resource's key
    • assertElementIsDisabled

      public void assertElementIsDisabled(String elementID)
      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

      public void assertElementIsEnabled(String elementID)
      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

      public String getElementValueByID(String elementID)
      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

      public void setRadioButton(String radioButtonName, String value)
      Sets a specific radio button.
      Parameters:
      radioButtonName - The name of the radio button.
      value - The value to set it too.
    • clickLinkWithKey

      public void clickLinkWithKey(String key)
      Clicks a link
      Parameters:
      key - The value of this key is the link clicked
    • getElementTextById

      public String getElementTextById(String elementId)
    • addRequestHeader

      public void addRequestHeader(String header, String value)
      Adds a request header for all subsequent requests.
      Parameters:
      header - header paramater.
      value - parameter value.
    • assertElementPresentByXPath

      public void assertElementPresentByXPath(String xpath)
    • getPageSource

      public String getPageSource()
    • clickButtonWithText

      public void clickButtonWithText(String buttonValueText)
    • assertElementNotPresentByXPath

      public void assertElementNotPresentByXPath(String xpath)
    • clickRadioOption

      public void clickRadioOption(String radioGroup, String radioOption)
    • assertRadioOptionSelected

      public void assertRadioOptionSelected(String radioGroup, String radioOption)
    • assertTextNotInTable

      public void assertTextNotInTable(String id, String text)
    • assertTitleEquals

      public void assertTitleEquals(String expectedTitle)
    • assertTitleNotEquals

      public void assertTitleNotEquals(String title)
    • assertLinkPresent

      public void assertLinkPresent(String linkId)
    • isElementWithIdPresent

      public boolean isElementWithIdPresent(String id)
    • getRestAssuredCookies

      protected io.restassured.http.Cookies getRestAssuredCookies()
    • getBaseUrlIPv6

      public String getBaseUrlIPv6()
    • log

      protected void log(String message)
    • getPageText

      protected String getPageText()
    • assertTextInTable

      public void assertTextInTable(String id, String text)
    • waitForElementById

      public com.atlassian.pageobjects.elements.PageElement waitForElementById(String id)
    • setTextField

      public void setTextField(String inputName, String value)
    • selectOption

      public void selectOption(String selectName, String label)
    • selectOptionBy

      public void selectOptionBy(org.openqa.selenium.By selectSelector, String label)
    • submit

      public void submit()
    • clickLinkWithExactText

      public void clickLinkWithExactText(String linkText)
    • findElementWithText

      protected io.atlassian.fugue.Option<com.atlassian.pageobjects.elements.PageElement> findElementWithText(String tagName, String text)
    • checkCheckbox

      public void checkCheckbox(String checkBoxName)
    • checkCheckbox

      public void checkCheckbox(String checkBoxName, boolean value)
    • assertTextFieldEquals

      public void assertTextFieldEquals(String formElementName, String expectedValue)
    • clickLink

      public void clickLink(String linkId)
    • clickLinkInNavbar

      public void clickLinkInNavbar(String linkId)
    • getLinkInNavbar

      public com.atlassian.pageobjects.elements.PageElement getLinkInNavbar(String linkId)
    • clickLinkInNavbarDropdown

      public void clickLinkInNavbarDropdown(String linkId)
    • getLinkInNavbarDropdown

      public com.atlassian.pageobjects.elements.PageElement getLinkInNavbarDropdown(String linkId)
    • clickButton

      public void clickButton(String buttonId)
    • assertTableRowCountEquals

      public void assertTableRowCountEquals(String id, int expectedRowCount)
    • assertTableNotPresent

      public void assertTableNotPresent(String id)
    • selectOptionByValue

      public void selectOptionByValue(String selectName, String value)
    • assertSelectedOptionEquals

      public void assertSelectedOptionEquals(String selectName, String optionLabel)
    • assertSelectOptionsEqual

      public void assertSelectOptionsEqual(String selectName, String[] optionLabels)
    • clickLinkWithText

      public void clickLinkWithText(String linkText)
    • assertTextInElement

      public void assertTextInElement(String elementId, String text)
    • assertCheckboxPresent

      public void assertCheckboxPresent(String checkBoxName)
    • assertCheckboxNotSelected

      public void assertCheckboxNotSelected(String checkBoxName)
    • getElementsByXPath

      public List<com.atlassian.pageobjects.elements.PageElement> getElementsByXPath(String xPath)
    • assertTitleMatch

      public void assertTitleMatch(String regexp)
    • getMessage

      public String getMessage(String key)
    • getMessage

      public String getMessage(String key, String... args)
    • getElementByXPath

      public com.atlassian.pageobjects.elements.PageElement getElementByXPath(String xPath)
    • clickElementByXPath

      public void clickElementByXPath(String xpath)
    • uncheckCheckbox

      public void uncheckCheckbox(String checkboxName)
    • assertElementNotPresent

      public void assertElementNotPresent(String anID)
    • assertButtonNotPresent

      public void assertButtonNotPresent(String buttonId)
    • assertSelectedOptionValueEquals

      public void assertSelectedOptionValueEquals(String selectName, String value)
    • assertCheckboxSelected

      public void assertCheckboxSelected(String checkBoxName)
    • assertCheckboxSelected

      public void assertCheckboxSelected(String checkBoxName, boolean value)
    • assertCheckboxNotPresent

      public void assertCheckboxNotPresent(String checkBoxName)
    • assertKeyNotPresent

      public void assertKeyNotPresent(String key)
    • getElementById

      public com.atlassian.pageobjects.elements.PageElement getElementById(String id)
    • assertRadioOptionNotPresent

      public void assertRadioOptionNotPresent(String name, String radioOption)
    • getElementTextByXPath

      public String getElementTextByXPath(String xpath)
    • submit

      public void submit(String buttonName)
    • gotoPage

      public void gotoPage(String url)
    • assertTextInTable

      public void assertTextInTable(String id, String[] text)
    • assertElementPresent

      public void assertElementPresent(String anID)
    • assertTablePresent

      public void assertTablePresent(String id)
    • assertLinkNotPresent

      public void assertLinkNotPresent(String linkId)
    • closeBrowser

      public void closeBrowser()
    • selectOption

      public void selectOption(String selectName, int index, String label)
    • setWorkingForm

      public void setWorkingForm(int index)
    • setWorkingForm

      public void setWorkingForm(String formName)
    • assertTextNotInTable

      public void assertTextNotInTable(String id, String[] text)
    • assertMatchInTable

      public void assertMatchInTable(String id, String regexp)
    • getTestContext

      public CrowdWebTestCase.TestContext getTestContext()
    • beginAt

      public void beginAt(String url)
    • getName

      public String getName()
    • isTextPresent

      public boolean isTextPresent(String text)
      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

      protected <T> List<T> scrapeTable(String id, com.google.common.base.Function<List<String>,T> mapper)
    • scrapeTable

      protected <T> List<T> scrapeTable(String id, List<String> headings, com.google.common.base.Function<List<String>,T> mapper)
    • scrapeTable

      protected <T> List<T> scrapeTable(String id, List<String> headings, com.google.common.base.Function<List<String>,T> mapper, boolean hasFooter)
    • getTable

      protected List<List<String>> getTable(String id)
    • equalToIgnoringWhiteSpace

      protected static org.hamcrest.Matcher<String> equalToIgnoringWhiteSpace(String s)
      Override IsEqualCompressingWhiteSpace and also ignore no-break space.
    • getText

      protected String getText(String key)
    • clearCookies

      public void clearCookies()
    • getTextForList

      protected com.google.common.collect.ImmutableList<String> getTextForList(String... keys)
    • getFinder

      protected com.atlassian.pageobjects.elements.PageElementFinder getFinder()
    • getPoller

      protected com.atlassian.webdriver.utils.element.WebDriverPoller getPoller()
    • setResourceBundleName

      protected void setResourceBundleName(String resourceBundleName)
    • disableIpAddressValidation

      protected void disableIpAddressValidation()
    • waitUntilPageLoad

      protected void waitUntilPageLoad()
    • getRadioWithValue

      protected static com.atlassian.pageobjects.elements.PageElement getRadioWithValue(List<com.atlassian.pageobjects.elements.PageElement> elements, String radioOption)
    • getRadiosFromRadioGroup

      protected List<com.atlassian.pageobjects.elements.PageElement> getRadiosFromRadioGroup(String radioGroup)