summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2014-07-15 11:35:04 +0300
committerBogdan Udrescu <bogdan@vaadin.com>2014-07-23 14:12:50 +0300
commitffb4594d8ff6b03b8e1392f5c47d814e408c9a45 (patch)
tree327f86db72abd97ad16d1283e26dcf964b3da81d
parentc43ebbac50a55e965738ec82c83a3fe08636b911 (diff)
downloadvaadin-framework-ffb4594d8ff6b03b8e1392f5c47d814e408c9a45.tar.gz
vaadin-framework-ffb4594d8ff6b03b8e1392f5c47d814e408c9a45.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();