Change-Id: Iaf1c3e4e49b74e1e72d5b43958f8e7ee5b7af4cc
@Override
protected String getScreenshotDirectory() {
- return getProperty("com.vaadin.testbench.screenshot.directory");
+ String screenshotDirectory = getProperty("com.vaadin.testbench.screenshot.directory");
+ if (screenshotDirectory == null) {
+ throw new RuntimeException(
+ "No screenshot directory defined. Use -Dcom.vaadin.testbench.screenshot.directory=<path>");
+ }
+ return screenshotDirectory;
}
@Override
// before running it. Leave unrelated files as-is
File errorDirectory = new File(getScreenshotErrorDirectory());
+ // Create errors directory if it does not exist
+ if (!errorDirectory.exists()) {
+ errorDirectory.mkdirs();
+ }
+
final String errorBase = getScreenshotErrorBaseName()
.replace("\\", "/");
File[] files = errorDirectory.listFiles(new FileFilter() {