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.screenshot.
Package com.vaadin.testbench.screenshot
Class ImageComparison
java.lang.Object
com.vaadin.testbench.screenshot.ImageComparison
Class with features for comparing 2 images.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
compareImages
(BufferedImage referenceImage, BufferedImage screenshotImage, double errorTolerance) boolean
imageEqualToReference
(BufferedImage screenshotImage, BufferedImage referenceImage, String referenceFileName, double errorTolerance) boolean
imageEqualToReference
(BufferedImage screenshotImage, String referenceFileId, double errorTolerance, org.openqa.selenium.Capabilities capabilities) Compare image [name] to image under /reference/.
-
Constructor Details
-
ImageComparison
public ImageComparison()
-
-
Method Details
-
imageEqualToReference
public boolean imageEqualToReference(BufferedImage screenshotImage, String referenceFileId, double errorTolerance, org.openqa.selenium.Capabilities capabilities) throws IOException Compare image [name] to image under /reference/. Images may differ in RGB hues 0.1% (default) per macroblock of 16x16
Parameters:
screenshotImage
- Image of canvas (must have proper dimensions)referenceFileId
- File id for this image without .png extensionerrorTolerance
- Allowed RGB error for a macroblock (value range 0-1 default 0.025 == 2.5%)capabilities
- browser capabilitiesReturns:
true
if images are the sameThrows:
IOException
- if the reference image cannot be read or error screenshot cannot be written -
imageEqualToReference
public boolean imageEqualToReference(BufferedImage screenshotImage, BufferedImage referenceImage, String referenceFileName, double errorTolerance) -
compareImages
public boolean compareImages(BufferedImage referenceImage, BufferedImage screenshotImage, double errorTolerance)
-