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

Commit cd575ee

Browse files
DylanLaceyjuliemr
authored andcommitted
feat(sauce provider): allow for custom server addresses when running against SauceLabs.
Use `config.sauceSeleniumAddress` to connect to a custom URL for Sauce Labs.
1 parent 06a70e4 commit cd575ee

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

docs/referenceConf.js

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ exports.config = {
5252
// The tests will be run remotely using Sauce Labs.
5353
sauceUser: null,
5454
sauceKey: null,
55+
// Use sauceSeleniumAddress if you need to customize the URL Protractor
56+
// uses to connect to sauce labs (for example, if you are tunneling selenium
57+
// traffic through a sauce connect tunnel). Default is
58+
// ondemand.saucelabs.com:80/wd/hub
59+
sauceSeleniumAddress: null,
5560

5661
// ---------------------------------------------------------------------------
5762
// ----- What tests to run ---------------------------------------------------

lib/driverProviders/sauce.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SauceDriverProvider.prototype.updateJob = function(update) {
2727
var deferred = q.defer();
2828
var self = this;
2929
this.driver_.getSession().then(function(session) {
30-
console.log('SauceLabs results avaiable at http://saucelabs.com/jobs/' +
30+
console.log('SauceLabs results available at http://saucelabs.com/jobs/' +
3131
session.getId());
3232
self.sauceServer_.updateJob(session.getId(), update, function(err) {
3333
if (err) {
@@ -55,11 +55,15 @@ SauceDriverProvider.prototype.setupEnv = function() {
5555
});
5656
this.config_.capabilities.username = this.config_.sauceUser;
5757
this.config_.capabilities.accessKey = this.config_.sauceKey;
58-
this.config_.seleniumAddress = 'http://' + this.config_.sauceUser + ':' +
59-
this.config_.sauceKey + '@ondemand.saucelabs.com:80/wd/hub';
58+
var auth = 'http://' + this.config_.sauceUser + ':' +
59+
this.config_.sauceKey + '@';
60+
this.config_.seleniumAddress = auth +
61+
(this.config_.sauceSeleniumAddress ? this.config_.sauceSeleniumAddress :
62+
'ondemand.saucelabs.com:80/wd/hub');
6063

61-
// Append filename to capabilities.name so that it's easier to identify tests
62-
if (this.config_.capabilities.name && this.config_.capabilities.shardTestFiles) {
64+
// Append filename to capabilities.name so that it's easier to identify tests.
65+
if (this.config_.capabilities.name &&
66+
this.config_.capabilities.shardTestFiles) {
6367
this.config_.capabilities.name += (
6468
':' + this.config_.specs.toString().replace(/^.*[\\\/]/, ''));
6569
}

0 commit comments

Comments
 (0)