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

Commit

Permalink
feat(webdriver): Allow users to use webdriver's disableEnvironmentOve…
Browse files Browse the repository at this point in the history
…rrides

Fixes #2300
  • Loading branch information
Alexander Albul authored and sjelin committed Jan 14, 2016
1 parent bd5c290 commit fb10c5c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 6 additions & 1 deletion docs/referenceConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,5 +340,10 @@ exports.config = {

// Turns off source map support. Stops protractor from registering global
// variable `source-map-support`. Defaults to `false`
skipSourceMapSupport: false
skipSourceMapSupport: false,

// Turns off WebDriver's environment variables overrides to ignore any
// environment variable and to only use the configuration in this file.
// Defaults to `true`
environmentOverrides: true
};
11 changes: 7 additions & 4 deletions lib/driverProviders/driverProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ DriverProvider.prototype.getExistingDrivers = function() {
* @return webdriver instance
*/
DriverProvider.prototype.getNewDriver = function() {
var newDriver = new webdriver.Builder().
usingServer(this.config_.seleniumAddress).
withCapabilities(this.config_.capabilities).
build();
var builder = new webdriver.Builder().
usingServer(this.config_.seleniumAddress).
withCapabilities(this.config_.capabilities);
if (this.config_.environmentOverrides === false) {
builder.disableEnvironmentOverrides();
}
var newDriver = builder.build();
this.drivers_.push(newDriver);
return newDriver;
};
Expand Down

0 comments on commit fb10c5c

Please sign in to comment.