Skip to content

Instantly share code, notes, and snippets.

@ChristiaanScheermeijer
Last active September 7, 2018 19:29
Show Gist options
  • Save ChristiaanScheermeijer/da286cf50c0e22fc31db to your computer and use it in GitHub Desktop.
Save ChristiaanScheermeijer/da286cf50c0e22fc31db to your computer and use it in GitHub Desktop.
Protractor configuration file using BrowserStack and multiple capabilities
{
"username": "your browserstack username",
"key": "your browserstack key"
}
/**
* @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