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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertClickable(org.openqa.selenium.WebElement element) protected voidChecks a WebElement if it has a CSS class or classes.protected voidassertDisabled(org.openqa.selenium.By by) protected voidassertDisabled(org.openqa.selenium.WebElement element) protected voidassertDisplayed(org.openqa.selenium.By by) protected voidassertDisplayed(org.openqa.selenium.WebElement element) protected voidassertEnabled(org.openqa.selenium.By by) protected voidassertEnabled(org.openqa.selenium.WebElement element) protected voidassertIsAt(Class<? extends AbstractPrimePage> pageClass) protected voidassertIsAt(String relativePath) protected voidassertIsAt(AbstractPrimePage page) protected voidChecks the browse console and asserts there are no SEVERE level messages.protected voidassertNotClickable(org.openqa.selenium.WebElement element) protected voidassertNotDisabled(org.openqa.selenium.By by) protected voidassertNotDisabled(org.openqa.selenium.WebElement element) protected voidassertNotDisplayed(org.openqa.selenium.By by) protected voidassertNotDisplayed(org.openqa.selenium.WebElement element) protected voidassertNotEnabled(org.openqa.selenium.By by) protected voidassertNotEnabled(org.openqa.selenium.WebElement element) protected voidassertNotPresent(org.openqa.selenium.By by) protected voidassertNotPresent(org.openqa.selenium.WebElement element) protected voidassertPresent(org.openqa.selenium.By by) protected voidassertPresent(org.openqa.selenium.WebElement element) protected voidassertText(org.openqa.selenium.WebElement element, String text) Asserts text of a web element and cleanses it of whitespace issues due to different WebDriver results.voidprotected voidClears the browser console.protected org.openqa.selenium.logging.LogEntriesgetLogsForType(String type) Utility method for checking the browser console for a specific type of message.protected org.openqa.selenium.WebDriverprotected <T extends AbstractPrimePage>
Tprotected voidstatic StringnormalizeSpace(String str) protected voidDumps 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- theLogTypeyou 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,
nullif null String input - Since:
- 3.0
- See Also:
-