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

Commit fb10c5c

Browse files
Alexander Albulsjelin
Alexander Albul
authored andcommitted
feat(webdriver): Allow users to use webdriver's disableEnvironmentOverrides
Fixes #2300
1 parent bd5c290 commit fb10c5c

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

docs/referenceConf.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -340,5 +340,10 @@ exports.config = {
340340

341341
// Turns off source map support. Stops protractor from registering global
342342
// variable `source-map-support`. Defaults to `false`
343-
skipSourceMapSupport: false
343+
skipSourceMapSupport: false,
344+
345+
// Turns off WebDriver's environment variables overrides to ignore any
346+
// environment variable and to only use the configuration in this file.
347+
// Defaults to `true`
348+
environmentOverrides: true
344349
};

lib/driverProviders/driverProvider.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ DriverProvider.prototype.getExistingDrivers = function() {
3232
* @return webdriver instance
3333
*/
3434
DriverProvider.prototype.getNewDriver = function() {
35-
var newDriver = new webdriver.Builder().
36-
usingServer(this.config_.seleniumAddress).
37-
withCapabilities(this.config_.capabilities).
38-
build();
35+
var builder = new webdriver.Builder().
36+
usingServer(this.config_.seleniumAddress).
37+
withCapabilities(this.config_.capabilities);
38+
if (this.config_.environmentOverrides === false) {
39+
builder.disableEnvironmentOverrides();
40+
}
41+
var newDriver = builder.build();
3942
this.drivers_.push(newDriver);
4043
return newDriver;
4144
};

0 commit comments

Comments
 (0)