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

Allow for custom server addresses when running against SauceLabs. #1054

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/driverProviders/sauce.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +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 + '@';

if (this.config_.seleniumAddress) {
this.config_.seleniumAddress = auth + this.config_.seleniumAddress;
} else {
this.config_.seleniumAddress = auth + 'ondemand.saucelabs.com:80/wd/hub';
}
this.config_.seleniumAddress = this.config_.seleniumAddress;

// Append filename to capabilities.name so that it's easier to identify tests
if (this.config_.capabilities.name && this.config_.capabilities.shardTestFiles) {
Expand Down
8 changes: 4 additions & 4 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ Runner.prototype.runTestPreparers = function() {
*
* Priority
* 1) if chromeOnly, use that
* 2) if seleniumAddress is given, use that
* 3) if a sauceAccount is given, use that.
* 2) if a sauceAccount is given, use that
* 3) if seleniumAddress is given, use that
* 4) if a seleniumServerJar is specified, use that
* 5) try to find the seleniumServerJar in protractor/selenium
*/
Runner.prototype.loadDriverProvider_ = function() {
var runnerPath;
if (this.config_.chromeOnly) {
runnerPath = './driverProviders/chrome';
} else if (this.config_.seleniumAddress) {
runnerPath = './driverProviders/hosted';
} else if (this.config_.sauceUser && this.config_.sauceKey) {
runnerPath = './driverProviders/sauce';
} else if (this.config_.seleniumAddress) {
runnerPath = './driverProviders/hosted';
} else if (this.config_.seleniumServerJar) {
runnerPath = './driverProviders/local';
} else if (this.config_.mockSelenium) {
Expand Down