We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
com.vaadin.testbench.commands.
Class ScreenshotComparator
- java.lang.Object
-
- com.vaadin.testbench.commands.ScreenshotComparator
-
public class ScreenshotComparator extends Object
-
-
Constructor Summary
Constructors Constructor and Description ScreenshotComparator()
-
Method Summary
All Methods Modifier and Type Method and Description static 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.
-
-
-
Method Detail
-
compareScreen
public static boolean compareScreen(String referenceId, ReferenceNameGenerator referenceNameGenerator, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) throws IOException
Throws:
-
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 imageReturns:
Throws:
-
compareScreen
public static boolean compareScreen(File reference, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) throws IOException
Throws:
-
compareScreen
public static boolean compareScreen(BufferedImage reference, String referenceName, ImageComparison imageComparison, org.openqa.selenium.TakesScreenshot takesScreenshot, org.openqa.selenium.HasCapabilities driver) throws IOException
Throws:
-
-