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

Commit c4ee56b

Browse files
committed
fix(sauce): sauceAgent passed incorrectly to sauce node module
closes #3410
1 parent 828e80c commit c4ee56b

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

lib/config.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,23 @@ export interface Config {
9393
sauceKey?: string;
9494
/**
9595
* Use sauceAgent if you need customize agent for https connection to
96-
* saucelabs.com (i.e. your computer behind corporate proxy)
96+
* saucelabs.com (i.e. your computer behind 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 where
101+
* sauce generates the agent for you based on the proxy. If a sauceProxy is
102+
* provided, the sauceAgent will be overridden.
103+
*/
104+
sauceAgent?: HttpProxyAgent;
105+
/**
106+
* Use sauceProxy that will get generated into an agent for https connection
107+
* to saucelabs.com (i.e. your computer behind corporate proxy).
108+
*
109+
* The sauceProxy is used to generate a sauceAgent. If a sauceProxy is
110+
* provided, the sauceAgent will be overridden.
97111
*/
98-
sauceAgent?: string;
112+
sauceProxy?: string;
99113
/**
100114
* Use sauceBuild if you want to group test capabilites by a build ID
101115
*/

lib/driverProviders/sauce.ts

Lines changed: 2 additions & 1 deletion
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

Lines changed: 4 additions & 0 deletions
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)