]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add check for screenshot parameter and creation of error folder
authorArtur Signell <artur@vaadin.com>
Tue, 3 Sep 2013 07:11:37 +0000 (10:11 +0300)
committerArtur Signell <artur@vaadin.com>
Tue, 3 Sep 2013 07:11:37 +0000 (10:11 +0300)
Change-Id: Iaf1c3e4e49b74e1e72d5b43958f8e7ee5b7af4cc

uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java

index 3ad0fba68b2ff699f32b943125b62d597826c2f6..b9087860364197a635601869432ce85ebb989564 100644 (file)
@@ -54,7 +54,12 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
 
     @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
index 175c1cef5d0f79d8f50dd96b4d384c88e32a8778..3510fe326c9acba2f52fbccff7921e1bccad1fde 100644 (file)
@@ -303,6 +303,11 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test {
         // 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() {