com.version1.webdriver.results.ResultsManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenium-java-test-automation Show documentation
Show all versions of selenium-java-test-automation Show documentation
A simple Selenium framework offering externalised configuration, a good selection of libraries for supporting
test data, simple WebDriver browser binary resolution and an opinionated approach for WebDriver test design.
package com.version1.webdriver.results;
import java.io.File;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Responsible for sorting out folders and anything else to do with reporting
*/
public class ResultsManager {
private SimpleDateFormat timestamp;
private File screenshotDirectory;
/**
*
*/
public ResultsManager() {
this.timestamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
}
/**
* Creates a run specific directory that is timestamped to store screenshots
* @return File representing created screenshot directory
*/
public File createScreenshotDirectory() {
this.screenshotDirectory = new File(
Paths.get("target").toString() + "/screenshots-" + timestamp.format(new Date()));
this.screenshotDirectory.mkdir();
return this.screenshotDirectory;
}
/**
*
* @return File representing screenshot directory
*/
public File getScreenshotDirectory() {
return this.screenshotDirectory;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy