diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-03-09 12:35:04 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-03-18 13:33:25 +0000 |
commit | d29b2dfd1e4e060aa2b8450706e1dd8fe2c731c7 (patch) | |
tree | ae0ab9532cae54c1b7bc0976875f954490aec2d6 /uitest/src/com | |
parent | 16066382c3429bc8ea8be909acd7724fe54e56ad (diff) | |
download | vaadin-framework-d29b2dfd1e4e060aa2b8450706e1dd8fe2c731c7.tar.gz vaadin-framework-d29b2dfd1e4e060aa2b8450706e1dd8fe2c731c7.zip |
Re-enable running tests locally with property
Change-Id: I6eed0dc802ca101c929a5bc3cb6f3141060524a3
Diffstat (limited to 'uitest/src/com')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index 8f8e446ce3..05ffa99511 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -25,8 +25,11 @@ import java.net.SocketException; import java.util.Enumeration; import java.util.Properties; +import org.openqa.selenium.remote.DesiredCapabilities; + import com.vaadin.testbench.annotations.BrowserFactory; import com.vaadin.testbench.annotations.RunOnHub; +import com.vaadin.testbench.parallel.Browser; /** * Provides values for parameters which depend on where the test is run. @@ -50,16 +53,38 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { private static final Properties properties = new Properties(); private static final File propertiesFile = new File("work", "eclipse-run-selected-test.properties"); + static { if (propertiesFile.exists()) { try { properties.load(new FileInputStream(propertiesFile)); + if (properties.containsKey(RUN_LOCALLY_PROPERTY)) { + System.setProperty("useLocalWebDriver", "true"); + DesiredCapabilities localBrowser = getRunLocallyCapabilities(); + System.setProperty( + "browsers.include", + localBrowser.getBrowserName() + + localBrowser.getVersion()); + } } catch (IOException e) { throw new RuntimeException(e); } } } + private static DesiredCapabilities getRunLocallyCapabilities() { + Browser localBrowser; + try { + localBrowser = Browser.valueOf(properties.getProperty( + RUN_LOCALLY_PROPERTY).toUpperCase()); + } catch (Exception e) { + System.err.println(e.getMessage()); + System.err.println("Falling back to FireFox"); + localBrowser = Browser.FIREFOX; + } + return localBrowser.getDesiredCapabilities(); + } + protected static String getProperty(String name) { String property = properties.getProperty(name); if (property == null) { |