public BufferedImage readScreenshot(String fileName) throws IOException { return ImageIO.read(new File(getScreenshotPath(fileName))); }
public void writeRunStepMetadata(Step step, String metadata) throws FileNotFoundException { try (PrintStream out = new PrintStream(new FileOutputStream(getScreenshotPath("metadata_" + step + ".json")))) { out.print(metadata); } } }
public String writeScreenshot(BufferedImage image, String url, String urlSubPath, int windowWidth, int yPosition, String step) throws IOException { final String screenshotPath = getScreenshotPath(url, urlSubPath, windowWidth, yPosition, step); writeScreenshot(screenshotPath, image); return screenshotPath; }
@Test public void shouldGenerateFullPathToPngFile() { final String fullFileNameWithPath = testee.getScreenshotPath("testurl", "/", 1001, 2002, "step"); assertThat(fullFileNameWithPath, is(writeScreenshotTestPath + "/screenshots/testurl_root_bbf1812_1001_02002_step.png")); }