summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2014-07-15 11:35:04 +0300
committerVaadin Code Review <review@vaadin.com>2014-07-17 13:26:11 +0000
commit05cd1c7c8ebfd98c57e9bb57cf2a1bf020298d30 (patch)
tree7ab86ac89ed71e69ae53f95a3750922d582cf16e
parent2c1d7bdbc2e284264b485fbcf7d9f3d1ef3180f2 (diff)
downloadvaadin-framework-05cd1c7c8ebfd98c57e9bb57cf2a1bf020298d30.tar.gz
vaadin-framework-05cd1c7c8ebfd98c57e9bb57cf2a1bf020298d30.zip
Explain what to do if chrome.driver.path is needed but missing (#14231)
Change-Id: Ibd6f890136d62a3b19f8c60158b4aa1397454f7e
-rw-r--r--uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java24
1 files changed, 19 insertions, 5 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
index 305caf1cb5..faa74d6c9d 100644
--- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
+++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
@@ -46,11 +46,12 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
private static final String HOSTNAME_PROPERTY = "com.vaadin.testbench.deployment.hostname";
private static final String PORT_PROPERTY = "com.vaadin.testbench.deployment.port";
private static final Properties properties = new Properties();
+ private static final File propertiesFile = new File("work",
+ "eclipse-run-selected-test.properties");
static {
- File file = new File("work", "eclipse-run-selected-test.properties");
- if (file.exists()) {
+ if (propertiesFile.exists()) {
try {
- properties.load(new FileInputStream(file));
+ properties.load(new FileInputStream(propertiesFile));
} catch (IOException e) {
throw new RuntimeException(e);
}
@@ -180,8 +181,21 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
driver = new FirefoxDriver();
}
} else if (BrowserUtil.isChrome(desiredCapabilities)) {
- System.setProperty("webdriver.chrome.driver",
- getProperty("chrome.driver.path"));
+ String propertyName = "chrome.driver.path";
+ String chromeDriverPath = getProperty(propertyName);
+ if (chromeDriverPath == null) {
+ throw new RuntimeException(
+ "You need to install ChromeDriver to use @"
+ + RunLocally.class.getSimpleName()
+ + " with Chrome."
+ + "\nFirst install it from https://code.google.com/p/selenium/wiki/ChromeDriver."
+ + "\nThen update "
+ + propertiesFile.getAbsolutePath()
+ + " to define a property named "
+ + propertyName
+ + " containing the path of your local ChromeDriver installation.");
+ }
+ System.setProperty("webdriver.chrome.driver", chromeDriverPath);
driver = new ChromeDriver();
} else if (BrowserUtil.isSafari(desiredCapabilities)) {
driver = new SafariDriver();