Last active
September 7, 2018 19:29
-
-
Save ChristiaanScheermeijer/da286cf50c0e22fc31db to your computer and use it in GitHub Desktop.
Protractor configuration file using BrowserStack and multiple capabilities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"username": "your browserstack username", | |
"key": "your browserstack key" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Christiaan Scheermeijer | |
* @copyright 2015 Video Dock b.v. | |
*/ | |
'use strict'; | |
var fs = require('fs'); | |
// read credentials file | |
var credentials = function() { | |
var data = fs.readFileSync('browserstack-credentials.json', 'utf8'); | |
return JSON.parse(data); | |
}(); | |
/** | |
* You don't want to add the same properties to each capability | |
*/ | |
var addCredentials = function (capability) { | |
capability['browserstack.user'] = credentials.username; | |
capability['browserstack.key'] = credentials.key; | |
capability['browserstack.local'] = 'true'; | |
capability['project'] = 'Your project name'; | |
return capability; | |
}; | |
exports.config = { | |
// capabilities collection | |
// http://www.browserstack.com/automate/capabilities | |
multiCapabilities: [ | |
addCredentials({ 'browserName': 'Chrome', 'version': '37', 'os': 'OS X', 'os_version': 'Mountain Lion'}), | |
addCredentials({ 'browserName': 'Chrome', 'version': '38', 'os': 'OS X', 'os_version': 'Mountain Lion'}) | |
], | |
// max parallel sessions | |
maxSessions: 2, | |
seleniumAddress: 'http://hub.browserstack.com/wd/hub', | |
// your specs | |
specs: [ | |
'specs/**/*' | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment