Package org.primefaces.selenium
Class AbstractPrimePageTest
java.lang.Object
org.primefaces.selenium.AbstractPrimePageTest
@TestInstance(PER_CLASS)
@TestMethodOrder(org.junit.jupiter.api.MethodOrderer.OrderAnnotation.class)
@ExtendWith(BootstrapExtension.class) @ExtendWith(WebDriverExtension.class) @ExtendWith(PageInjectionExtension.class)
public abstract class AbstractPrimePageTest
extends Object
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertClickable
(org.openqa.selenium.WebElement element) protected void
Checks a WebElement if it has a CSS class or classes.protected void
assertDisabled
(org.openqa.selenium.By by) protected void
assertDisabled
(org.openqa.selenium.WebElement element) protected void
assertDisplayed
(org.openqa.selenium.By by) protected void
assertDisplayed
(org.openqa.selenium.WebElement element) protected void
assertEnabled
(org.openqa.selenium.By by) protected void
assertEnabled
(org.openqa.selenium.WebElement element) protected void
assertIsAt
(Class<? extends AbstractPrimePage> pageClass) protected void
assertIsAt
(String relativePath) protected void
assertIsAt
(AbstractPrimePage page) protected void
Checks the browse console and asserts there are no SEVERE level messages.protected void
assertNotClickable
(org.openqa.selenium.WebElement element) protected void
assertNotDisabled
(org.openqa.selenium.By by) protected void
assertNotDisabled
(org.openqa.selenium.WebElement element) protected void
assertNotDisplayed
(org.openqa.selenium.By by) protected void
assertNotDisplayed
(org.openqa.selenium.WebElement element) protected void
assertNotEnabled
(org.openqa.selenium.By by) protected void
assertNotEnabled
(org.openqa.selenium.WebElement element) protected void
assertNotPresent
(org.openqa.selenium.By by) protected void
assertNotPresent
(org.openqa.selenium.WebElement element) protected void
assertPresent
(org.openqa.selenium.By by) protected void
assertPresent
(org.openqa.selenium.WebElement element) 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.void
protected void
Clears the browser console.protected org.openqa.selenium.logging.LogEntries
getLogsForType
(String type) Utility method for checking the browser console for a specific type of message.protected org.openqa.selenium.WebDriver
protected <T extends AbstractPrimePage>
Tprotected void
static String
normalizeSpace
(String str) protected void
Dumps to System.out or System.err any messages found in the browser console.
-
Constructor Details
-
AbstractPrimePageTest
public AbstractPrimePageTest()
-
-
Method Details
-
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) -
assertIsAt
-
assertClickable
protected void assertClickable(org.openqa.selenium.WebElement element) -
assertNotClickable
protected void assertNotClickable(org.openqa.selenium.WebElement element) -
assertIsAt
-
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
Utility method for checking the browser console for a specific type of message.- Parameters:
type
- theLogType
you are searching for- Returns:
- either NULL if not available or the
LogEntries
-
assertIsAt
-
goTo
-
goTo
-
getWebDriver
protected org.openqa.selenium.WebDriver getWebDriver() -
assertText
Asserts text of a web element and cleanses it of whitespace issues due to different WebDriver results.- Parameters:
element
- the element to check its texttext
- the text expected in the element
-
assertCss
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 checkcssClasses
- the CSS class or classes to look for
-
normalizeSpace
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:
-