Interface VisualProcessingProvider


public interface VisualProcessingProvider
SHAFT-owned contract for optional visual-processing implementations.

Implementations may use optional computer-vision libraries, while engine callers interact only with SHAFT and JDK types. Providers are discovered through ServiceLoader.

  • Method Summary

    Modifier and Type
    Method
    Description
    compareAgainstBaseline(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, byte[] elementScreenshot, ImageProcessingActions.VisualValidationEngine visualValidationEngine, String referenceImagePath, String differencesImagePath)
    Compares an element screenshot against its visual baseline using the requested optional engine.
    findImageWithinCurrentPage(String referenceImagePath, byte[] currentPageScreenshot)
    Finds a reference image within a page screenshot.
    void
    Loads any native libraries required by this provider.
  • Method Details

    • findImageWithinCurrentPage

      List<Integer> findImageWithinCurrentPage(String referenceImagePath, byte[] currentPageScreenshot)
      Finds a reference image within a page screenshot.
      Parameters:
      referenceImagePath - path to the reference image
      currentPageScreenshot - encoded current-page screenshot
      Returns:
      the matched x/y coordinates, or an empty list when no match is found
    • compareAgainstBaseline

      Boolean compareAgainstBaseline(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By elementLocator, byte[] elementScreenshot, ImageProcessingActions.VisualValidationEngine visualValidationEngine, String referenceImagePath, String differencesImagePath)
      Compares an element screenshot against its visual baseline using the requested optional engine.
      Parameters:
      driver - active WebDriver instance
      elementLocator - locator of the element being compared
      elementScreenshot - encoded screenshot of the element
      visualValidationEngine - requested visual validation engine
      referenceImagePath - path to the saved reference image
      differencesImagePath - path prefix for a generated differences image
      Returns:
      true when the comparison passes or creates a new baseline
    • load

      void load()
      Loads any native libraries required by this provider.