diff options
author | Leif Åstrand <leif@vaadin.com> | 2015-03-23 08:20:23 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2015-03-23 08:20:23 +0200 |
commit | 20d5456c3d5fb825783d7311ebd797c9ae8690f9 (patch) | |
tree | 9401f94b7d84209bdc991c15995512c56e50d03f /uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | |
parent | 16c67cfab9b3dd2dbf324caa612fa3a2d15550d0 (diff) | |
parent | 04272699b8f429a2bc3b8f0a41e20a604213895e (diff) | |
download | vaadin-framework-20d5456c3d5fb825783d7311ebd797c9ae8690f9.tar.gz vaadin-framework-20d5456c3d5fb825783d7311ebd797c9ae8690f9.zip |
Merge remote-tracking branch 'origin/master' into grid-7.5
Change-Id: I53218c269f0701cddd8279bf25c493950144f4cb
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | 30 |
1 files changed, 30 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..d0134a4feb 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,43 @@ 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"); + private static final String FIREFOX_PATH = "firefox.path"; + 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()); + } + if (properties.containsKey(FIREFOX_PATH)) { + System.setProperty(FIREFOX_PATH, + properties.getProperty(FIREFOX_PATH)); + } } 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) { |