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.
Class ImageComparison
- java.lang.Object
-
- com.vaadin.testbench.screenshot.ImageComparison
-
public class ImageComparison extends Object
Class with features for comparing 2 images.
-
-
Constructor Summary
Constructors Constructor and Description ImageComparison()
-
Method Summary
All Methods Modifier and Type Method and Description boolean
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/.
-
-
-
Method Detail
-
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 same
Throws:
-
imageEqualToReference
public boolean imageEqualToReference(BufferedImage screenshotImage, BufferedImage referenceImage, String referenceFileName, double errorTolerance)
-
compareImages
public boolean compareImages(BufferedImage referenceImage, BufferedImage screenshotImage, double errorTolerance)
-
-