Class AbstractPrimePageTest

    • Constructor Detail

      • AbstractPrimePageTest

        public AbstractPrimePageTest()
    • Method Detail

      • beforeEach

        @BeforeEach
        public void beforeEach()
      • assertPresent

        protected void assertPresent​(org.openqa.selenium.WebElement element)
      • assertPresent

        protected void assertPresent​(org.openqa.selenium.By by)
      • assertNotPresent

        protected void assertNotPresent​(org.openqa.selenium.WebElement element)
      • assertNotPresent

        protected void assertNotPresent​(org.openqa.selenium.By by)
      • assertDisplayed

        protected void assertDisplayed​(org.openqa.selenium.WebElement element)
      • assertDisplayed

        protected void assertDisplayed​(org.openqa.selenium.By by)
      • assertNotDisplayed

        protected void assertNotDisplayed​(org.openqa.selenium.WebElement element)
      • assertNotDisplayed

        protected void assertNotDisplayed​(org.openqa.selenium.By by)
      • assertEnabled

        protected void assertEnabled​(org.openqa.selenium.WebElement element)
      • assertEnabled

        protected void assertEnabled​(org.openqa.selenium.By by)
      • assertNotEnabled

        protected void assertNotEnabled​(org.openqa.selenium.WebElement element)
      • assertNotEnabled

        protected void assertNotEnabled​(org.openqa.selenium.By by)
      • assertDisabled

        protected void assertDisabled​(org.openqa.selenium.WebElement element)
      • assertDisabled

        protected void assertDisabled​(org.openqa.selenium.By by)
      • assertNotDisabled

        protected void assertNotDisabled​(org.openqa.selenium.WebElement element)
      • assertNotDisabled

        protected void assertNotDisabled​(org.openqa.selenium.By by)
      • assertClickable

        protected void assertClickable​(org.openqa.selenium.WebElement element)
      • assertNotClickable

        protected void assertNotClickable​(org.openqa.selenium.WebElement element)
      • assertNoJavascriptErrors

        protected void assertNoJavascriptErrors()
        Checks the browse console and asserts there are no SEVERE level messages.
      • clearConsole

        protected void clearConsole()
        Clears the browser console.
      • printConsole

        protected void printConsole()
        Dumps to System.out or System.err any messages found in the browser console.
      • getLogsForType

        protected org.openqa.selenium.logging.LogEntries getLogsForType​(String type)
        Utility method for checking the browser console for a specific type of message.
        Parameters:
        type - the LogType you are searching for
        Returns:
        either NULL if not available or the LogEntries
      • assertIsAt

        protected void assertIsAt​(String relativePath)
      • goTo

        protected void goTo​(String partialUrl)
      • getWebDriver

        protected org.openqa.selenium.WebDriver getWebDriver()
      • assertText

        protected void assertText​(org.openqa.selenium.WebElement element,
                                  String text)
        Asserts text of a web element and cleanses it of whitespace issues due to different WebDriver results.
        Parameters:
        element - the element to check its text
        text - the text expected in the element
      • assertCss

        protected void assertCss​(org.openqa.selenium.WebElement element,
                                 String... cssClasses)
        Checks a WebElement if it has a CSS class or classes. If more than one is listed then ALL must be found on the element.
        Parameters:
        element - the element to check
        cssClasses - the CSS class or classes to look for
      • normalizeSpace

        public static String normalizeSpace​(String str)

        Similar to http://www.w3.org/TR/xpath/#function-normalize -space

        The function returns the argument string with whitespace normalized by using to remove leading and trailing whitespace and then replacing sequences of whitespace characters by a single space.

        In XML Whitespace characters are the same as those allowed by the S production, which is S ::= (#x20 | #x9 | #xD | #xA)+

        Java's regexp pattern \s defines whitespace as [ \t\n\x0B\f\r]

        For reference:

        • \x0B = vertical tab
        • \f = #xC = form feed
        • #x20 = space
        • #x9 = \t
        • #xA = \n
        • #xD = \r

        The difference is that Java's whitespace includes vertical tab and form feed, which this functional will also normalize. Additionally removes control characters (char <= 32) from both ends of this String.

        Parameters:
        str - the source String to normalize whitespaces from, may be null
        Returns:
        the modified string with whitespace normalized, null if null String input
        Since:
        3.0
        See Also:
        Pattern, http://www.w3.org/TR/xpath/#function-normalize-space