Skip to content

Commit

Permalink
Merge pull request #82 from eskape/master
Browse files Browse the repository at this point in the history
Fix for setting up the remote webdriver capability: webdriver.remote.browser.version
  • Loading branch information
wakaleo committed Jun 24, 2015
2 parents b06c399 + 395a9a6 commit 6086f27
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private DesiredCapabilities capabilitiesForDriver(String driver) {

Preconditions.checkNotNull(driverType, "Unsupported remote driver type: ");

if (driverType == SupportedWebDriver.REMOTE) {
if (shouldUseARemoteDriver()) {
return (DesiredCapabilities) enhancedCapabilities(remoteCapabilities());
} else {
return (DesiredCapabilities) enhancedCapabilities(realBrowserCapabilities(driverType));
Expand Down Expand Up @@ -418,7 +418,11 @@ private DesiredCapabilities realBrowserCapabilities(SupportedWebDriver driverTyp
}

private DesiredCapabilities remoteCapabilities() {
String remoteBrowser = ThucydidesSystemProperty.WEBDRIVER_REMOTE_DRIVER.from(environmentVariables, "firefox");
String remoteBrowser = ThucydidesSystemProperty.WEBDRIVER_REMOTE_DRIVER.from(environmentVariables, getDriverFrom(environmentVariables));
if (remoteBrowser == null) {
remoteBrowser = "firefox";
}

DesiredCapabilities capabilities = realBrowserCapabilities(driverTypeFor(remoteBrowser));
capabilities.setCapability("idle-timeout",EXTRA_TIME_TO_TAKE_SCREENSHOTS);

Expand All @@ -431,9 +435,10 @@ private DesiredCapabilities remoteCapabilities() {
}

if (environmentVariables.getProperty(ThucydidesSystemProperty.WEBDRIVER_REMOTE_BROWSER_VERSION) != null) {
capabilities.setCapability("version", Platform.valueOf(environmentVariables.getProperty(ThucydidesSystemProperty.WEBDRIVER_REMOTE_BROWSER_VERSION)));
capabilities.setCapability("version", environmentVariables.getProperty(ThucydidesSystemProperty.WEBDRIVER_REMOTE_BROWSER_VERSION));
}


return capabilities;
}

Expand Down

0 comments on commit 6086f27

Please sign in to comment.