Class WebDriverBrowserValidationsBuilder
java.lang.Object
com.shaft.validation.internal.WebDriverBrowserValidationsBuilder
- All Implemented Interfaces:
BrowserAssertions
-
Constructor Summary
ConstructorsConstructorDescriptionWebDriverBrowserValidationsBuilder(ValidationEnums.ValidationCategory validationCategory, org.openqa.selenium.WebDriver driver, StringBuilder reportMessageBuilder) -
Method Summary
Modifier and TypeMethodDescriptionUse this to check against the current browser alert text.Use this to check against a certain browser attributeUse this to check that the current page matches its visual-regression baseline screenshot (full-page pixel diff via OpenCV).matchesScreenshot(VisualComparisonOptions options) Same asmatchesScreenshot(), but with diff-budget/mask options (seeVisualComparisonOptions).text()Use this to check against the current page text content.title()Use this to check against the current page titleurl()Use this to check against the current page URL
-
Constructor Details
-
WebDriverBrowserValidationsBuilder
public WebDriverBrowserValidationsBuilder(ValidationEnums.ValidationCategory validationCategory, org.openqa.selenium.WebDriver driver, StringBuilder reportMessageBuilder)
-
-
Method Details
-
attribute
Use this to check against a certain browser attribute- Specified by:
attributein interfaceBrowserAssertions- Parameters:
browserAttribute- the target browser attribute that will be checked against- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
url
Use this to check against the current page URL- Specified by:
urlin interfaceBrowserAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
title
Use this to check against the current page title- Specified by:
titlein interfaceBrowserAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
alertText
Use this to check against the current browser alert text.- Specified by:
alertTextin interfaceBrowserAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
text
Use this to check against the current page text content.- Specified by:
textin interfaceBrowserAssertions- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
matchesScreenshot
Use this to check that the current page matches its visual-regression baseline screenshot (full-page pixel diff via OpenCV). On the first test run this method takes a full-page screenshot and the test passes, saving it as the baseline for subsequent runs. The comparison runs when this terminal assertion is called.- Specified by:
matchesScreenshotin interfaceBrowserAssertions- Returns:
- a ValidationsExecutor object to optionally set a custom validation message
-
matchesScreenshot
Same asmatchesScreenshot(), but with diff-budget/mask options (seeVisualComparisonOptions). The comparison executes immediately.- Specified by:
matchesScreenshotin interfaceBrowserAssertions- Parameters:
options- the visual comparison options (diff budgets, masks), ornullfor defaults- Returns:
- a ValidationsExecutor object to optionally set a custom validation message
-