com.vaadin.testbench.screenshot.

Class ImageFileUtil


  • public class ImageFileUtil
    extends Object
    • Constructor Detail

      • ImageFileUtil

        public ImageFileUtil()
    • Method Detail

      • getScreenshotReferenceDirectory

        public static String getScreenshotReferenceDirectory()

        Returns the directory used for screenshot references.

        Returns:

        The screenshot reference directory, ending in a slash.

      • getScreenshotErrorDirectory

        public static String getScreenshotErrorDirectory()

        Returns the directory used for screenshot error images.

        Returns:

        The screenshot error directory, ending in a slash.

      • createScreenshotDirectoriesIfNeeded

        public static void createScreenshotDirectoriesIfNeeded()

        Creates all directories used to store screenshots unless they already exist.

      • readReferenceImage

        public static BufferedImage readReferenceImage(String referenceImageFileName)
                                                throws IOException

        Reads the given reference image into a BufferedImage

        Parameters:

        referenceImageFileName -

        Returns:

        Throws:

        IOException

      • getErrorScreenshotFile

        public static File getErrorScreenshotFile(String errorImageFileName)
      • getReferenceScreenshotFile

        public static File getReferenceScreenshotFile(String referenceImageFileName)
      • getReferenceImageFileNames

        public static 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 with getReferenceScreenshotFile(String).

        Parameters:

        referenceImageFileName -

        capabilities -

        Returns:

        file names of reference images