Package com.vaadin.testbench.commands
Class ScreenshotComparator
java.lang.Object
com.vaadin.testbench.commands.ScreenshotComparator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
compareScreen
(BufferedImage reference, String referenceName, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) static boolean
compareScreen
(File reference, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) static boolean
compareScreen
(String referenceId, ReferenceNameGenerator referenceNameGenerator, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) static BufferedImage
cropToElement
(org.openqa.selenium.WebElement element, BufferedImage fullScreen) Crops the image to show only the element.
-
Constructor Details
-
ScreenshotComparator
public ScreenshotComparator()
-
-
Method Details
-
compareScreen
public static boolean compareScreen(String referenceId, ReferenceNameGenerator referenceNameGenerator, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) throws IOException - Throws:
IOException
-
cropToElement
public static BufferedImage cropToElement(org.openqa.selenium.WebElement element, BufferedImage fullScreen) throws IOException Crops the image to show only the element. If the element is partly off screen, crops to show the part of the element which is in the screenshot- Parameters:
element
- the element to retain in the screenshotfullScreen
- the full screen image- Returns:
- the cropped image
- Throws:
IOException
- if element outside of the screenshot
-
compareScreen
public static boolean compareScreen(File reference, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) throws IOException - Throws:
IOException
-
compareScreen
public static boolean compareScreen(BufferedImage reference, String referenceName, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) throws IOException - Throws:
IOException
-