From 582411b7ad6c0f9176b231dc51dc328b98affbdf Mon Sep 17 00:00:00 2001 From: Evan Duncan Date: Thu, 24 Mar 2016 22:35:36 -0500 Subject: [PATCH] feat(driverProvider/sauce) Add build id as a configurable option --- docs/referenceConf.js | 2 ++ lib/driverProviders/sauce.js | 1 + spec/driverprovider_test.js | 15 ++++++++------- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/referenceConf.js b/docs/referenceConf.js index 1aa92cb46..cacb00b6f 100644 --- a/docs/referenceConf.js +++ b/docs/referenceConf.js @@ -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 diff --git a/lib/driverProviders/sauce.js b/lib/driverProviders/sauce.js index 10acd37d2..fa5131f9d 100644 --- a/lib/driverProviders/sauce.js +++ b/lib/driverProviders/sauce.js @@ -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 + diff --git a/spec/driverprovider_test.js b/spec/driverprovider_test.js index 88347e362..d323cc537 100644 --- a/spec/driverprovider_test.js +++ b/spec/driverprovider_test.js @@ -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) { @@ -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) { @@ -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) { @@ -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) { @@ -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) { @@ -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) { @@ -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) {