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

Commit dd2ccbb

Browse files
Pavel Strashkinheathkit
Pavel Strashkin
authored andcommitted
feat(saucelabs): Add Sauce Labs protocol customization support
1 parent 183cd80 commit dd2ccbb

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

lib/cli.ts

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ let allowedNames = [
4646
'sauceKey',
4747
'sauceAgent',
4848
'sauceBuild',
49+
'sauceSeleniumUseHttp',
4950
'sauceSeleniumAddress',
5051
'browserstackUser',
5152
'browserstackKey',

lib/config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ export interface Config {
136136
* Use sauceBuild if you want to group test capabilites by a build ID
137137
*/
138138
sauceBuild?: string;
139+
/**
140+
* If true, Protractor will use http:// protocol instead of https:// to
141+
* connect to Sauce Labs defined by sauceSeleniumAddress.
142+
*
143+
* default: false
144+
*/
145+
sauceSeleniumUseHttp?: boolean;
139146
/**
140147
* Use sauceSeleniumAddress if you need to customize the URL Protractor
141148
* uses to connect to sauce labs (for example, if you are tunneling selenium

lib/driverProviders/sauce.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export class Sauce extends DriverProvider {
6363
this.config_.capabilities['username'] = this.config_.sauceUser;
6464
this.config_.capabilities['accessKey'] = this.config_.sauceKey;
6565
this.config_.capabilities['build'] = this.config_.sauceBuild;
66-
let auth = 'https://' + this.config_.sauceUser + ':' + this.config_.sauceKey + '@';
66+
let protocol = this.config_.sauceSeleniumUseHttp ? 'http://' : 'https://';
67+
let auth = protocol + this.config_.sauceUser + ':' + this.config_.sauceKey + '@';
6768
this.config_.seleniumAddress = auth +
6869
(this.config_.sauceSeleniumAddress ? this.config_.sauceSeleniumAddress :
6970
'ondemand.saucelabs.com:443/wd/hub');

0 commit comments

Comments
 (0)