Class WebDriverBrowserValidationsBuilder

java.lang.Object
com.shaft.validation.internal.WebDriverBrowserValidationsBuilder
All Implemented Interfaces:
BrowserAssertions

public class WebDriverBrowserValidationsBuilder extends Object implements BrowserAssertions
  • Constructor Details

  • Method Details

    • attribute

      public NativeValidationsBuilder attribute(String browserAttribute)
      Use this to check against a certain browser attribute
      Specified by:
      attribute in interface BrowserAssertions
      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:
      url in interface BrowserAssertions
      Returns:
      a NativeValidationsBuilder object to continue building your validation
    • title

      public NativeValidationsBuilder title()
      Use this to check against the current page title
      Specified by:
      title in interface BrowserAssertions
      Returns:
      a NativeValidationsBuilder object to continue building your validation
    • alertText

      public NativeValidationsBuilder alertText()
      Use this to check against the current browser alert text.
      Specified by:
      alertText in interface BrowserAssertions
      Returns:
      a NativeValidationsBuilder object to continue building your validation
    • text

      public NativeValidationsBuilder text()
      Use this to check against the current page text content.
      Specified by:
      text in interface BrowserAssertions
      Returns:
      a NativeValidationsBuilder object to continue building your validation
    • matchesScreenshot

      public ValidationsExecutor 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:
      matchesScreenshot in interface BrowserAssertions
      Returns:
      a ValidationsExecutor object to optionally set a custom validation message
    • matchesScreenshot

      public ValidationsExecutor matchesScreenshot(VisualComparisonOptions options)
      Same as matchesScreenshot(), but with diff-budget/mask options (see VisualComparisonOptions). The comparison executes immediately.
      Specified by:
      matchesScreenshot in interface BrowserAssertions
      Parameters:
      options - the visual comparison options (diff budgets, masks), or null for defaults
      Returns:
      a ValidationsExecutor object to optionally set a custom validation message