Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
feat(webdriver): allow configuration of all SeleniumServer arguments
Browse files Browse the repository at this point in the history
You can now pass a complete object of configuration for the SeleniumServer class.
This allows enabling loopback on the selenium server.
  • Loading branch information
Tim Roes authored and juliemr committed Jan 26, 2016
1 parent 9532779 commit b693256
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/referenceConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ exports.config = {
// seleniumArgs: ['-browserTimeout=60']
// Ignored if seleniumServerJar is null.
seleniumArgs: [],
// Can be an object which will be passed to the SeleniumServer class as args.
// If you specify `args` or `port` in this object, it will overwrite the values
// set via `seleniumPort` and `seleniumArgs`.
localSeleniumStandaloneOpts: null,
// ChromeDriver location is used to help find the chromedriver binary.
// This will be passed to the Selenium jar as the system property
// webdriver.chrome.driver. If null, Selenium will
Expand Down
19 changes: 14 additions & 5 deletions lib/driverProviders/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,24 @@ LocalDriverProvider.prototype.setupEnv = function() {

log.puts('Starting selenium standalone server...');

var serverConf = this.config_.localSeleniumStandaloneOpts || {};

// If args or port is not set use seleniumArgs and seleniumPort
// for backward compatibility
if (serverConf.args === undefined) {
serverConf.args = this.config_.seleniumArgs || [];
}
if (serverConf.port === undefined) {
serverConf.port = this.config_.seleniumPort;
}

// configure server
if (this.config_.chromeDriver) {
this.config_.seleniumArgs.push('-Dwebdriver.chrome.driver=' +
serverConf.args.push('-Dwebdriver.chrome.driver=' +
this.config_.chromeDriver);
}
this.server_ = new remote.SeleniumServer(this.config_.seleniumServerJar, {
args: this.config_.seleniumArgs,
port: this.config_.seleniumPort
});

this.server_ = new remote.SeleniumServer(this.config_.seleniumServerJar, serverConf);

//start local server, grab hosted address, and resolve promise
this.server_.start().then(function(url) {
Expand Down

0 comments on commit b693256

Please sign in to comment.