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 TypeMethodDescriptioncompareAgainstBaseline(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.voidload()Loads any native libraries required by this provider.
-
Method Details
-
findImageWithinCurrentPage
Finds a reference image within a page screenshot.- Parameters:
referenceImagePath- path to the reference imagecurrentPageScreenshot- 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 instanceelementLocator- locator of the element being comparedelementScreenshot- encoded screenshot of the elementvisualValidationEngine- requested visual validation enginereferenceImagePath- path to the saved reference imagedifferencesImagePath- path prefix for a generated differences image- Returns:
truewhen the comparison passes or creates a new baseline
-
load
void load()Loads any native libraries required by this provider.
-