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

Commit

Permalink
feat(driverProvider/sauce) Add build id as a configurable option
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Duncan authored and cnishina committed Mar 31, 2016
1 parent b6f1a63 commit 582411b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions docs/referenceConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ exports.config = {
// Use sauceAgent if you need customize agent for https connection to
// saucelabs.com (i.e. your computer behind corporate proxy)
sauceAgent: null,
// Use sauceBuild if you want to group test capabilites by a build ID
sauceBuild: 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
Expand Down
1 change: 1 addition & 0 deletions lib/driverProviders/sauce.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ SauceDriverProvider.prototype.setupEnv = function() {
});
this.config_.capabilities.username = this.config_.sauceUser;
this.config_.capabilities.accessKey = this.config_.sauceKey;
this.config_.capabilities.build = this.config_.sauceBuild;
var auth = 'http://' + this.config_.sauceUser + ':' +
this.config_.sauceKey + '@';
this.config_.seleniumAddress = auth +
Expand Down
15 changes: 8 additions & 7 deletions spec/driverprovider_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var env = require('./environment');

var testDriverProvider = function(driverProvider) {
return driverProvider.setupEnv().then(function() {
var driver = driverProvider.getDriver();
var driver = driverProvider.getNewDriver();
var deferred = q.defer();
driver.get('about:blank');
driver.getCurrentUrl().then(function(url) {
Expand Down Expand Up @@ -45,7 +45,7 @@ var chromeConfig = {
browserName: 'chrome'
}
};
testDriverProvider(require('../lib/driverProviders/direct')(chromeConfig)).
testDriverProvider(require('../built/driverProviders/direct')(chromeConfig)).
then(function() {
console.log('direct.dp with chrome working!');
}, function(err) {
Expand All @@ -57,7 +57,7 @@ var firefoxConfig = {
browserName: 'firefox'
}
};
testDriverProvider(require('../lib/driverProviders/direct')(firefoxConfig)).
testDriverProvider(require('../built/driverProviders/direct')(firefoxConfig)).
then(function() {
console.log('direct.dp with firefox working!');
}, function(err) {
Expand All @@ -70,7 +70,7 @@ var hostedConfig = {
browserName: 'firefox'
}
};
testDriverProvider(require('../lib/driverProviders/hosted')(hostedConfig)).
testDriverProvider(require('../built/driverProviders/hosted')(hostedConfig)).
then(function() {
console.log('hosted.dp working!');
}, function(err) {
Expand All @@ -83,7 +83,7 @@ var hostedPromisedConfig = {
browserName: 'firefox'
}
};
testDriverProvider(require('../lib/driverProviders/hosted')(hostedPromisedConfig)).
testDriverProvider(require('../built/driverProviders/hosted')(hostedPromisedConfig)).
then(function() {
console.log('hosted.dp with promises working!');
}, function(err) {
Expand All @@ -96,7 +96,7 @@ var localConfig = {
browserName: 'chrome'
}
};
testDriverProvider(require('../lib/driverProviders/local')(localConfig)).
testDriverProvider(require('../built/driverProviders/local')(localConfig)).
then(function() {
console.log('local.dp working!');
}, function(err) {
Expand All @@ -107,11 +107,12 @@ if (argv.sauceUser && argv.sauceKey) {
var sauceConfig = {
sauceUser: argv.sauceUser,
sauceKey: argv.sauceKey,
sauceBuild: argv.sauceBuild,
capabilities: {
browserName: 'chrome'
}
};
testDriverProvider(require('../lib/driverProviders/sauce')(sauceConfig)).
testDriverProvider(require('../built/driverProviders/sauce')(sauceConfig)).
then(function() {
console.log('sauce.dp working!');
}, function(err) {
Expand Down

0 comments on commit 582411b

Please sign in to comment.