Class PlaywrightVisualValidationsBuilder

java.lang.Object
com.shaft.validation.internal.VisualValidationsBuilder
com.shaft.gui.playwright.validation.PlaywrightVisualValidationsBuilder

public final class PlaywrightVisualValidationsBuilder extends VisualValidationsBuilder
Playwright variant of VisualValidationsBuilder: adds a Playwright Locator-based mask(...) overload and routes perform() through PlaywrightValidationsExecutor instead of the Selenium-oriented base executor.
  • Method Details

    • maxDiffPixels

      public PlaywrightVisualValidationsBuilder maxDiffPixels(int maxDiffPixels)
      Description copied from class: VisualValidationsBuilder
      Caps the number of differing pixels allowed for the comparison to still pass.
      Overrides:
      maxDiffPixels in class VisualValidationsBuilder
      Parameters:
      maxDiffPixels - maximum allowed differing pixel count
      Returns:
      this builder, to continue chaining options
    • maxDiffPixelRatio

      public PlaywrightVisualValidationsBuilder maxDiffPixelRatio(double maxDiffPixelRatio)
      Description copied from class: VisualValidationsBuilder
      Caps the ratio of differing pixels (0.0-1.0) allowed for the comparison to still pass.
      Overrides:
      maxDiffPixelRatio in class VisualValidationsBuilder
      Parameters:
      maxDiffPixelRatio - maximum allowed differing pixel ratio
      Returns:
      this builder, to continue chaining options
    • mask

      public PlaywrightVisualValidationsBuilder mask(com.microsoft.playwright.Locator... masks)
      Excludes the region(s) covered by the given Playwright locators from the pixel comparison.
      Parameters:
      masks - Playwright locators of elements whose bounding boxes should be excluded from the diff
      Returns:
      this builder, to continue chaining options
    • perform

      public ValidationsExecutor perform()
      Description copied from class: VisualValidationsBuilder
      Executes the visual-regression comparison (or saves a new baseline on first run / when -Dshaft.updateSnapshots=true is set).
      Overrides:
      perform in class VisualValidationsBuilder
      Returns:
      a ValidationsExecutor object retained for source compatibility