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

Commit

Permalink
feat(sauce provider): allow for custom server addresses when running …
Browse files Browse the repository at this point in the history
…against SauceLabs.

Use `config.sauceSeleniumAddress` to connect to a custom URL for Sauce Labs.
  • Loading branch information
DylanLacey authored and juliemr committed Aug 4, 2014
1 parent 06a70e4 commit cd575ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions docs/referenceConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ exports.config = {
// The tests will be run remotely using Sauce Labs.
sauceUser: null,
sauceKey: null,
// Use sauceSeleniumAddress if you need to customize the URL Protractor
// uses to connect to sauce labs (for example, if you are tunneling selenium
// traffic through a sauce connect tunnel). Default is
// ondemand.saucelabs.com:80/wd/hub
sauceSeleniumAddress: null,

// ---------------------------------------------------------------------------
// ----- What tests to run ---------------------------------------------------
Expand Down
14 changes: 9 additions & 5 deletions lib/driverProviders/sauce.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SauceDriverProvider.prototype.updateJob = function(update) {
var deferred = q.defer();
var self = this;
this.driver_.getSession().then(function(session) {
console.log('SauceLabs results avaiable at http://saucelabs.com/jobs/' +
console.log('SauceLabs results available at http://saucelabs.com/jobs/' +
session.getId());
self.sauceServer_.updateJob(session.getId(), update, function(err) {
if (err) {
Expand Down Expand Up @@ -55,11 +55,15 @@ SauceDriverProvider.prototype.setupEnv = function() {
});
this.config_.capabilities.username = this.config_.sauceUser;
this.config_.capabilities.accessKey = this.config_.sauceKey;
this.config_.seleniumAddress = 'http://' + this.config_.sauceUser + ':' +
this.config_.sauceKey + '@ondemand.saucelabs.com:80/wd/hub';
var auth = 'http://' + this.config_.sauceUser + ':' +
this.config_.sauceKey + '@';
this.config_.seleniumAddress = auth +
(this.config_.sauceSeleniumAddress ? this.config_.sauceSeleniumAddress :
'ondemand.saucelabs.com:80/wd/hub');

// Append filename to capabilities.name so that it's easier to identify tests
if (this.config_.capabilities.name && this.config_.capabilities.shardTestFiles) {
// Append filename to capabilities.name so that it's easier to identify tests.
if (this.config_.capabilities.name &&
this.config_.capabilities.shardTestFiles) {
this.config_.capabilities.name += (
':' + this.config_.specs.toString().replace(/^.*[\\\/]/, ''));
}
Expand Down

0 comments on commit cd575ee

Please sign in to comment.