Use any browser on BrowserStack!
NOTE: You have to run local tunnel first:
$ java -jar BrowserStackTunnel.jar <KEY> localhost,9876,0
The easiest way is to keep karma-browserstack-launcher
as a devDependency in your package.json
.
{
"devDependencies": {
"karma": "~0.10",
"karma-browserstack-launcher": "~0.1"
}
}
You can also add it by this command:
npm install karma-browserstack-launcher --save-dev
// karma.conf.js
module.exports = function(config) {
config.set({
// global config of your BrowserStack account
browserStack: {
username: 'jamesbond',
accessKey: '007'
},
// define browsers
customLaunchers: {
bs_firefox_mac: {
base: 'BrowserStack',
browser: 'firefox',
os: 'mac',
version: '21.0'
},
bs_iphone5: {
base: 'BrowserStack',
device: 'iPhone 5',
os: 'ios',
version: '6.0'
}
},
browsers: ['bs_firefox_mac', 'bs_iphone5']
});
};
username
your BS username (email), you can also useBROWSER_STACK_USERNAME
env variable.accessKey
your BS access key (password), you can also useBROWSER_STACK_ACCESS_KEY
env variable.startTunnel
do you wanna establish the BrowserStack tunnel ? (defaults totrue
)
device
name of the devicebrowser
name of the browserversion
version of the browseros
which platform ?
For an example project of, check out Karma's e2e test.
For more information on Karma see the homepage.