Package com.vaadin.testbench.screenshot
Class ImageFileUtil.ImageFileUtilImpl
java.lang.Object
com.vaadin.testbench.screenshot.ImageFileUtil.ImageFileUtilImpl
- Enclosing class:
- ImageFileUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates all directories used to store screenshots unless they already exist.getErrorScreenshotFile
(String errorImageFileName) getReferenceImageFileNames
(String referenceImageFileName, org.openqa.selenium.Capabilities capabilities) Returns the relative file names of reference images.getReferenceScreenshotFile
(String referenceImageFileName) Returns the directory used for screenshot error images.Returns the directory used for screenshot references.readReferenceImage
(String referenceImageFileName) Reads the given reference image into a BufferedImage
-
Constructor Details
-
ImageFileUtilImpl
public ImageFileUtilImpl()
-
-
Method Details
-
getScreenshotReferenceDirectory
Returns the directory used for screenshot references.- Returns:
- The screenshot reference directory, ending in a slash.
-
getScreenshotErrorDirectory
Returns the directory used for screenshot error images.- Returns:
- The screenshot error directory, ending in a slash.
-
createScreenshotDirectoriesIfNeeded
public void createScreenshotDirectoriesIfNeeded()Creates all directories used to store screenshots unless they already exist. -
readReferenceImage
Reads the given reference image into a BufferedImage- Parameters:
referenceImageFileName
- The name of the reference image file.- Returns:
- a BufferedImage containing the reference image.
- Throws:
IOException
- if an error occurs during reading.
-
getErrorScreenshotFile
-
getReferenceScreenshotFile
-
getReferenceImageFileNames
public List<String> getReferenceImageFileNames(String referenceImageFileName, org.openqa.selenium.Capabilities capabilities) Returns the relative file names of reference images. The actual image file for a relative file name can be retrieved withgetReferenceScreenshotFile(String)
.- Parameters:
referenceImageFileName
- id part of the reference image file namecapabilities
- used to compute the full name of the alternative references- Returns:
- file names of reference images
-