From 3954d200f0d1236738cdcd147d5b07540d812bba Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 28 May 2015 23:14:05 +0300 Subject: [PATCH] Allow specifying location of PhantomJS binary Change-Id: Idf04ba5c3712a387010bc2a28a119e81499f1f75 --- uitest/eclipse-run-selected-test.properties | 8 ++++++-- .../src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/uitest/eclipse-run-selected-test.properties b/uitest/eclipse-run-selected-test.properties index 535885f877..e0f93bfc7c 100644 --- a/uitest/eclipse-run-selected-test.properties +++ b/uitest/eclipse-run-selected-test.properties @@ -6,7 +6,7 @@ ; ; -; For both TestBench 2 and 3 +; For both TestBench 2 and 4 ; ; Location of the screenshot directory. @@ -18,13 +18,17 @@ com.vaadin.testbench.screenshot.directory=:8888/ ; -; For only TestBench 3 +; For only TestBench 4 ; ; Simulates @RunLocally with the given value on all test classes without a @RunLocally annotation. ; Use simple browser name (phantomjs, chrome, firefox, ie8, ie9, ie10, ie11) ; com.vaadin.testbench.runLocally=firefox +; Optional override to specify the location of the Firefox/PhantomJS binary +; firefox.path=/usr/bin/firefox +; phantomjs.binary.path=/usr/bin/phantomjs + ; By default using @RunLocally annotation in Framework tests is not allowed. ; Running tests locally can be done with com.vaadin.testbench.runLocally parameter above. ; Uncomment the following line if you want to be able to use @RunLocally annotation diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index 61b7ef4dde..77b9b9ef7d 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -57,6 +57,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { private static final File propertiesFile = new File("work", "eclipse-run-selected-test.properties"); private static final String FIREFOX_PATH = "firefox.path"; + private static final String PHANTOMJS_PATH = "phantomjs.binary.path"; static { if (propertiesFile.exists()) { @@ -74,6 +75,10 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { System.setProperty(FIREFOX_PATH, properties.getProperty(FIREFOX_PATH)); } + if (properties.containsKey(PHANTOMJS_PATH)) { + System.setProperty(PHANTOMJS_PATH, + properties.getProperty(PHANTOMJS_PATH)); + } } catch (IOException e) { throw new RuntimeException(e); } -- 2.39.5