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

Commit 7266902

Browse files
authored
fix(sauce): sauceAgent passed incorrectly to sauce node module (#3415)
closes #3410
1 parent 0f35006 commit 7266902

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

lib/config.ts

+16-3
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,23 @@ export interface Config {
9292
*/
9393
sauceKey?: string;
9494
/**
95-
* Use sauceAgent if you need customize agent for https connection to
96-
* saucelabs.com (i.e. your computer behind corporate proxy)
95+
* Use sauceAgent if you need custom HTTP agent to connect to saucelabs.com.
96+
* This is needed if your computer is behind a corporate proxy.
97+
*
98+
* To match sauce agent implementation, use
99+
* [HttpProxyAgent](https://github.com/TooTallNate/node-http-proxy-agent)
100+
* to generate the agent or use sauceProxy as an alternative. If a
101+
* sauceProxy is provided, the sauceAgent will be overridden.
102+
*/
103+
sauceAgent?: HttpProxyAgent;
104+
/**
105+
* Use sauceProxy if you are behind a corporate proxy to connect to
106+
* saucelabs.com.
107+
*
108+
* The sauceProxy is used to generate an HTTP agent. If a sauceProxy is
109+
* provided, the sauceAgent will be overridden.
97110
*/
98-
sauceAgent?: string;
111+
sauceProxy?: string;
99112
/**
100113
* Use sauceBuild if you want to group test capabilites by a build ID
101114
*/

lib/driverProviders/sauce.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export class Sauce extends DriverProvider {
5757
this.sauceServer_ = new SauceLabs({
5858
username: this.config_.sauceUser,
5959
password: this.config_.sauceKey,
60-
agent: this.config_.sauceAgent
60+
agent: this.config_.sauceAgent,
61+
proxy: this.config_.sauceProxy
6162
});
6263
this.config_.capabilities['username'] = this.config_.sauceUser;
6364
this.config_.capabilities['accessKey'] = this.config_.sauceKey;

lib/globals.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,7 @@ declare namespace webdriver {
105105
isPresent?: Function;
106106
}
107107
}
108+
109+
declare interface HttpProxyAgent {
110+
constructor(opts: Object): HttpProxyAgent;
111+
}

0 commit comments

Comments
 (0)