org.kuali.rice.testtools.selenium
Class JiraAwareAftBase

java.lang.Object
  extended by org.kuali.rice.testtools.selenium.AutomatedFunctionalTestBase
      extended by org.kuali.rice.testtools.selenium.JiraAwareAftBase
All Implemented Interfaces:
JiraAwareFailable
Direct Known Subclasses:
WebDriverLegacyITBase

public abstract class JiraAwareAftBase
extends AutomatedFunctionalTestBase
implements JiraAwareFailable

Jira Aware Automated Functional Test Base.

TODO: promote the various jiraAware methods from WebDriverLegacyITBase

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
 
Fields inherited from class org.kuali.rice.testtools.selenium.AutomatedFunctionalTestBase
shouldNavigate, testUrl
 
Constructor Summary
JiraAwareAftBase()
           
 
Method Summary
protected  void assertButtonDisabledByText(String buttonText)
          WebDriverUtils#assertButtonDisabledByText
protected  void assertButtonEnabledByText(String buttonText)
          WebDriverUtils.assertButtonEnabledByText.
protected  void assertDataTableContains(String[][] data)
           
protected  void assertDataTableContains(String[][] data, String tableClass)
           
protected  void assertElementPresent(org.openqa.selenium.By by)
           
protected  void assertElementPresent(org.openqa.selenium.By by, String message)
           
protected  void assertElementPresent(String locator)
           
protected  void assertElementPresentByLinkText(String linkText)
           
protected  void assertElementPresentByName(String name)
           
protected  void assertElementPresentByName(String name, String message)
           
protected  void assertElementPresentByXpath(String locator)
           
protected  void assertElementPresentByXpath(String locator, String message)
           
protected  void assertEquals(boolean expected, boolean actual)
           
protected  void assertEquals(int expected, int actual)
           
protected  void assertEquals(String message, int expected, int actual)
           
protected  void assertEquals(String expected, String actual)
           
protected  void assertFalse(boolean booleanToAssertFalse)
          If booleanToAssertFalse is true call jiraAwareFail.
protected  void assertFalse(String message, boolean booleanToAssertFalse)
          If booleanToAssertFalse is true call jiraAwareFail.
protected  void assertIsNotVisible(org.openqa.selenium.By by)
           
protected  void assertIsNotVisible(org.openqa.selenium.By by, String message)
           
protected  void assertIsNotVisible(String locator)
           
protected  void assertIsNotVisibleByXpath(String xpath)
           
protected  void assertIsNotVisibleByXpath(String xpath, String message)
           
protected  void assertIsVisible(org.openqa.selenium.By by, String message)
           
protected  void assertIsVisible(String locator)
           
protected  void assertIsVisibleById(String id)
           
protected  void assertIsVisibleByXpath(String xpath, String message)
           
protected  void assertLabeledTextNotPresent(String[][] labeledText)
           
protected  void assertLabeledTextPresent(String[][] labeledText)
           
protected  void assertLabeledTextPresent(String label, String text)
           
protected  void assertResultCount(String count)
           
protected  void assertTextNotPresent(String text)
          Asset that the given text does not occur in the page Warning, this only does a check against the page source.
protected  void assertTextNotPresent(String text, String message)
          Assert that the given text does not occur in the page, and add an additional message to the failure
protected  void assertTextNotPresent(String text, String cssSelector, String message)
           
protected  void assertTextPresent(String text)
          WARNING: this only does a check against the page source.
protected  void assertTextPresent(String text, String message)
          WARNING: this only does a check against the page source.
protected  void assertTextPresent(String text, String cssSelector, String message)
           
protected  void assertTrue(boolean booleanToAssertTrue)
          If booleanToAssertTrue is false call jiraAwareFail.
protected  void assertTrue(String message, boolean booleanToAssertTrue)
          If booleanToAssertTrue is false call jiraAwareFail.
protected abstract  void checkForIncidentReport(String locator, String message)
          Implement to check for Incident Report or other on screen errors, should call JiraAwareFailable.fail(java.lang.String) to fail, without calling any of the jiraAwareFail methods to avoid an infinite loop.
 void fail(String message)
           Fail in a framework appropriate way, should not call jiraAwareFail.
protected  org.openqa.selenium.WebElement findDataTableRow(String keyText)
           
protected  org.openqa.selenium.WebElement findDataTableRow(String keyText, String className)
           
protected  org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
          WebDriverUtils.findElement(org.openqa.selenium.WebDriver, org.openqa.selenium.By).
protected  org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by, org.openqa.selenium.WebElement elementToFindOn)
           
protected abstract  org.openqa.selenium.WebDriver getDriver()
          WebDriver used in fail and pass to display jGrowl messages.
protected  boolean isLabeledTextPresent(String label, String text)
           
 boolean isPassed()
           
protected  boolean isVisible(org.openqa.selenium.By by)
           
protected  boolean isVisible(String locator)
           
protected  boolean isVisibleById(String id)
           
protected  boolean isVisibleByXpath(String locator)
           
protected  void jiraAwareFail(org.openqa.selenium.By by, String message, Throwable throwable)
          checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).
 void jiraAwareFail(String message)
          jiraAwareFail is a hook to do things like checking for incident reports, 404s, 503s, etc, the last statement typically would be a call to JiraAwareUtil#fail(String, String, JiraAwareFailable to check for Jira matches.
 void jiraAwareFail(String contents, String message)
          jiraAwareFail is a hook to do things like checking for incident reports, 404s, 503s, etc, the last statement typically would be a call to JiraAwareUtil#fail(String, String, JiraAwareFailable to check for Jira matches.
 void jiraAwareFail(String contents, String message, Throwable throwable)
          jiraAwareFail is a hook to do things like checking for incident reports, 404s, 503s, etc, the last statement typically would be a call to JiraAwareUtil#fail(String, String, Throwable, JiraAwareFailable to check for Jira matches.
protected  void jiraAwareFail(String contents, String message, Throwable throwable, JiraAwareFailable failable)
          checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).
protected  org.openqa.selenium.WebElement jiraAwareType(org.openqa.selenium.By by, String text)
           
protected  org.openqa.selenium.WebElement jiraAwareType(org.openqa.selenium.By by, String text, String failureMessage)
           
protected  org.openqa.selenium.WebElement jiraAwareTypeByName(String name, String text)
           
protected  org.openqa.selenium.WebElement jiraAwareTypeByName(String name, String text, String failureMessage)
           
protected  void jiraAwareWaitAndClick(org.openqa.selenium.By by, String message)
          checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).
protected  void jiraAwareWaitAndClick(org.openqa.selenium.By by, String message, JiraAwareFailable failable)
          jiraAwareWaitFor(org.openqa.selenium.By)
protected  org.openqa.selenium.WebElement jiraAwareWaitFor(org.openqa.selenium.By by)
          WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).
protected  org.openqa.selenium.WebElement jiraAwareWaitFor(org.openqa.selenium.By by, int seconds, String message)
          WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).
protected  org.openqa.selenium.WebElement jiraAwareWaitFor(org.openqa.selenium.By by, String message)
          WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).
protected  void jiraAwareWaitFor(org.openqa.selenium.By by, String message, JiraAwareFailable failable)
          WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).
protected  void jiraAwareWaitFors(org.openqa.selenium.By by, String message)
          WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).
protected  void passed()
           Set the test state to passed, call jGrowl sticky with success, required to be called at the conclusion of a test for the saucelabs state of a test to be updated to passed.
protected  void selectOption(org.openqa.selenium.By by, String optionValue)
          Uses Selenium's findElements method which does not throw a test exception if not found.
protected  void selectOptionByName(String name, String optionValue)
           
protected  void selectOptionByXpath(String locator, String optionValue)
           
protected  org.openqa.selenium.WebElement waitAndType(org.openqa.selenium.By by, String text, String message)
           
 
Methods inherited from class org.kuali.rice.testtools.selenium.AutomatedFunctionalTestBase
enableBookmarkMode, enableNavigationMode, getBookmarkUrl, getNavigationUrl, getTestUrl, navigate, navigateInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraAwareAftBase

public JiraAwareAftBase()
Method Detail

checkForIncidentReport

protected abstract void checkForIncidentReport(String locator,
                                               String message)
Implement to check for Incident Report or other on screen errors, should call JiraAwareFailable.fail(java.lang.String) to fail, without calling any of the jiraAwareFail methods to avoid an infinite loop.

Parameters:
locator - used in failure message if there is an incident report can be blank
message - used in failure message if there is an incident report can be blank

getDriver

protected abstract org.openqa.selenium.WebDriver getDriver()
WebDriver used in fail and pass to display jGrowl messages.

Returns:
WebDriver used to display jGrowl messages on fail and pass

assertButtonDisabledByText

protected void assertButtonDisabledByText(String buttonText)
WebDriverUtils#assertButtonDisabledByText

Parameters:
buttonText - of button to assert is disabled

assertButtonEnabledByText

protected void assertButtonEnabledByText(String buttonText)
WebDriverUtils.assertButtonEnabledByText.

Parameters:
buttonText - of button to assert is disabled

assertDataTableContains

protected void assertDataTableContains(String[][] data)
                                throws InterruptedException
Throws:
InterruptedException

assertDataTableContains

protected void assertDataTableContains(String[][] data,
                                       String tableClass)
                                throws InterruptedException
Throws:
InterruptedException

assertElementPresentByName

protected void assertElementPresentByName(String name)

assertElementPresentByName

protected void assertElementPresentByName(String name,
                                          String message)

assertElementPresentByXpath

protected void assertElementPresentByXpath(String locator)

assertElementPresent

protected void assertElementPresent(org.openqa.selenium.By by)

assertElementPresent

protected void assertElementPresent(org.openqa.selenium.By by,
                                    String message)

assertElementPresentByXpath

protected void assertElementPresentByXpath(String locator,
                                           String message)

assertElementPresentByLinkText

protected void assertElementPresentByLinkText(String linkText)

assertElementPresent

protected void assertElementPresent(String locator)

assertEquals

protected void assertEquals(boolean expected,
                            boolean actual)

assertEquals

protected void assertEquals(int expected,
                            int actual)

assertEquals

protected void assertEquals(String message,
                            int expected,
                            int actual)

assertEquals

protected void assertEquals(String expected,
                            String actual)

assertFalse

protected void assertFalse(boolean booleanToAssertFalse)
If booleanToAssertFalse is true call jiraAwareFail.

Parameters:
booleanToAssertFalse -

assertFalse

protected void assertFalse(String message,
                           boolean booleanToAssertFalse)
If booleanToAssertFalse is true call jiraAwareFail.

Parameters:
message - to include if booleanToAssertTrue is true
booleanToAssertFalse -

assertIsVisible

protected void assertIsVisible(String locator)

assertIsVisible

protected void assertIsVisible(org.openqa.selenium.By by,
                               String message)

assertIsVisibleById

protected void assertIsVisibleById(String id)

assertIsVisibleByXpath

protected void assertIsVisibleByXpath(String xpath,
                                      String message)

assertIsNotVisible

protected void assertIsNotVisible(org.openqa.selenium.By by)

assertIsNotVisible

protected void assertIsNotVisible(org.openqa.selenium.By by,
                                  String message)

assertIsNotVisible

protected void assertIsNotVisible(String locator)

assertIsNotVisibleByXpath

protected void assertIsNotVisibleByXpath(String xpath)

assertIsNotVisibleByXpath

protected void assertIsNotVisibleByXpath(String xpath,
                                         String message)

assertLabeledTextNotPresent

protected void assertLabeledTextNotPresent(String[][] labeledText)

assertLabeledTextPresent

protected void assertLabeledTextPresent(String[][] labeledText)

assertLabeledTextPresent

protected void assertLabeledTextPresent(String label,
                                        String text)

assertResultCount

protected void assertResultCount(String count)
                          throws InterruptedException
Throws:
InterruptedException

assertTextPresent

protected void assertTextPresent(String text)
WARNING: this only does a check against the page source. The form url can have random character that match simple text. A narrowly scoped locator for assertTextPresent(String String String)

Parameters:
text -

assertTextPresent

protected void assertTextPresent(String text,
                                 String message)
WARNING: this only does a check against the page source. The form url can have random character that match simple text

Parameters:
text -

assertTextPresent

protected void assertTextPresent(String text,
                                 String cssSelector,
                                 String message)
Parameters:
text -

assertTextNotPresent

protected void assertTextNotPresent(String text)
Asset that the given text does not occur in the page Warning, this only does a check against the page source. The form url can have random character that match simple text

Parameters:
text - the text to search for

assertTextNotPresent

protected void assertTextNotPresent(String text,
                                    String message)
Assert that the given text does not occur in the page, and add an additional message to the failure

Parameters:
text - the text to search for
message - the message to add to the failure

assertTextNotPresent

protected void assertTextNotPresent(String text,
                                    String cssSelector,
                                    String message)
Parameters:
text -

assertTrue

protected void assertTrue(boolean booleanToAssertTrue)
If booleanToAssertTrue is false call jiraAwareFail.

Parameters:
booleanToAssertTrue -

assertTrue

protected void assertTrue(String message,
                          boolean booleanToAssertTrue)
If booleanToAssertTrue is false call jiraAwareFail.

Parameters:
message - to include if booleanToAssertTrue is false
booleanToAssertTrue -

fail

public void fail(String message)

Fail in a framework appropriate way, should not call jiraAwareFail.

Set passed to false, call jGrowl sticky with the given message, then fails using JiraAwareFailable.fail(java.lang.String).

Specified by:
fail in interface JiraAwareFailable
Parameters:
message - to display with failure

findDataTableRow

protected org.openqa.selenium.WebElement findDataTableRow(String keyText)
                                                   throws InterruptedException
Throws:
InterruptedException

findDataTableRow

protected org.openqa.selenium.WebElement findDataTableRow(String keyText,
                                                          String className)
                                                   throws InterruptedException
Throws:
InterruptedException

findElement

protected org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
WebDriverUtils.findElement(org.openqa.selenium.WebDriver, org.openqa.selenium.By).

Parameters:
by - to find element with
Returns:
WebElement found with given by

findElement

protected org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by,
                                                     org.openqa.selenium.WebElement elementToFindOn)

isLabeledTextPresent

protected boolean isLabeledTextPresent(String label,
                                       String text)

isVisible

protected boolean isVisible(String locator)

isVisible

protected boolean isVisible(org.openqa.selenium.By by)

isVisibleById

protected boolean isVisibleById(String id)

isVisibleByXpath

protected boolean isVisibleByXpath(String locator)

jiraAwareFail

public void jiraAwareFail(String message)
jiraAwareFail is a hook to do things like checking for incident reports, 404s, 503s, etc, the last statement typically would be a call to JiraAwareUtil#fail(String, String, JiraAwareFailable to check for Jira matches. checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).

Specified by:
jiraAwareFail in interface JiraAwareFailable
Parameters:
message - to check for a Jira match and fail with.

jiraAwareFail

public void jiraAwareFail(String contents,
                          String message)
jiraAwareFail is a hook to do things like checking for incident reports, 404s, 503s, etc, the last statement typically would be a call to JiraAwareUtil#fail(String, String, JiraAwareFailable to check for Jira matches. checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).

Specified by:
jiraAwareFail in interface JiraAwareFailable
Parameters:
contents - to check for a Jira match
message - to check for a Jira match and fail with.

jiraAwareFail

protected void jiraAwareFail(org.openqa.selenium.By by,
                             String message,
                             Throwable throwable)
checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).

Parameters:
by - to check for a Jira match
message - to check for a Jira match and fail with.
throwable - to check for a Jira match

jiraAwareFail

public void jiraAwareFail(String contents,
                          String message,
                          Throwable throwable)
jiraAwareFail is a hook to do things like checking for incident reports, 404s, 503s, etc, the last statement typically would be a call to JiraAwareUtil#fail(String, String, Throwable, JiraAwareFailable to check for Jira matches. checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).

Specified by:
jiraAwareFail in interface JiraAwareFailable
Parameters:
contents - to check for a Jira match
message - to check for a Jira match and fail with.
throwable - to check for a Jira match

jiraAwareFail

protected void jiraAwareFail(String contents,
                             String message,
                             Throwable throwable,
                             JiraAwareFailable failable)
checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).

Parameters:
contents - to check for a Jira match
message - to check for a Jira match and fail with.
throwable - to check for a Jira match
failable - to call fail on

jiraAwareWaitAndClick

protected void jiraAwareWaitAndClick(org.openqa.selenium.By by,
                                     String message)
                              throws InterruptedException
checkForIncidentReport(java.lang.String, java.lang.String) and JiraAwareFailureUtils.fail(java.lang.String, org.kuali.rice.testtools.common.JiraAwareFailable).

Parameters:
by - to click on
message - on failure
Throws:
InterruptedException

jiraAwareType

protected org.openqa.selenium.WebElement jiraAwareType(org.openqa.selenium.By by,
                                                       String text)

jiraAwareType

protected org.openqa.selenium.WebElement jiraAwareType(org.openqa.selenium.By by,
                                                       String text,
                                                       String failureMessage)

jiraAwareTypeByName

protected org.openqa.selenium.WebElement jiraAwareTypeByName(String name,
                                                             String text)

jiraAwareTypeByName

protected org.openqa.selenium.WebElement jiraAwareTypeByName(String name,
                                                             String text,
                                                             String failureMessage)

jiraAwareWaitAndClick

protected void jiraAwareWaitAndClick(org.openqa.selenium.By by,
                                     String message,
                                     JiraAwareFailable failable)
                              throws InterruptedException
jiraAwareWaitFor(org.openqa.selenium.By)

Parameters:
by - to click on
message - on failure
failable - to fail on if not found
Throws:
InterruptedException

jiraAwareWaitFor

protected org.openqa.selenium.WebElement jiraAwareWaitFor(org.openqa.selenium.By by)
                                                   throws InterruptedException
WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).

Parameters:
by - to find
Returns:
WebElement found with given by
Throws:
InterruptedException

jiraAwareWaitFor

protected org.openqa.selenium.WebElement jiraAwareWaitFor(org.openqa.selenium.By by,
                                                          String message)
                                                   throws InterruptedException
WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).

Parameters:
by - to find
message - on failure
Returns:
WebElement found with given by
Throws:
InterruptedException

jiraAwareWaitFors

protected void jiraAwareWaitFors(org.openqa.selenium.By by,
                                 String message)
                          throws InterruptedException
WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).

Parameters:
by - to find
message - on failure
Throws:
InterruptedException

jiraAwareWaitFor

protected void jiraAwareWaitFor(org.openqa.selenium.By by,
                                String message,
                                JiraAwareFailable failable)
                         throws InterruptedException
WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).

Parameters:
by - to find
message - on failure
failable - to fail if given by is not found
Throws:
InterruptedException

jiraAwareWaitFor

protected org.openqa.selenium.WebElement jiraAwareWaitFor(org.openqa.selenium.By by,
                                                          int seconds,
                                                          String message)
                                                   throws InterruptedException
WebDriverUtils.waitFor(org.openqa.selenium.WebDriver, int, org.openqa.selenium.By, java.lang.String).

Parameters:
by - to find
seconds - to wait
message - on failure
Returns:
WebElement found with given by
Throws:
InterruptedException

isPassed

public boolean isPassed()
Returns:
passed

selectOptionByName

protected void selectOptionByName(String name,
                                  String optionValue)
                           throws InterruptedException
Throws:
InterruptedException

selectOptionByXpath

protected void selectOptionByXpath(String locator,
                                   String optionValue)
                            throws InterruptedException
Throws:
InterruptedException

selectOption

protected void selectOption(org.openqa.selenium.By by,
                            String optionValue)
                     throws InterruptedException
Uses Selenium's findElements method which does not throw a test exception if not found.

Parameters:
by -
optionValue -
Throws:
InterruptedException

passed

protected void passed()

Set the test state to passed, call jGrowl sticky with success, required to be called at the conclusion of a test for the saucelabs state of a test to be updated to passed.


waitAndType

protected org.openqa.selenium.WebElement waitAndType(org.openqa.selenium.By by,
                                                     String text,
                                                     String message)
                                              throws InterruptedException
Throws:
InterruptedException


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.