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

Description
It seems that webDriverProxy variable is missing in the 'sauce.js' file! Therefore, we have the following workaround in place to have our Protractor test run on Sauce Labs via our corporate proxy:
- In protractor config.js add following lines
exports.config = {
sauceUser:'SauceUser',
sauceKey:'SauceKey',
webDriverProxy: 'http://proxy.mysite.com:18099',
// things you had in there before
};
- In node_modules/protractor/lib/driverProviders/sauce.js file (i.e. the DriverProvider for Sauce Labs in Protractor), add this:
this.sauceServer_ = new SauceLabs({
username: this.config_.sauceUser,
password: this.config_.sauceKey,
agent: this.config_.sauceAgent,
proxy: this.config_.webDriverProxy // this line needs to be added
});
- In node_modules/protractor/lib/driverProviders/driverProvider.js modify the getNewDriver function as below.
DriverProvider.prototype.getNewDriver = function() {
var newDriver = new webdriver.Builder().
usingServer(this.config_.seleniumAddress).
usingWebDriverProxy(this.config_.webDriverProxy). // here we have webDriverProxy
withCapabilities(this.config_.capabilities).
build();
this.drivers_.push(newDriver);
return newDriver;
};