Last active
June 28, 2018 21:16
-
-
Save klamping/da24f00fec653cb489137dbdbc1ffe40 to your computer and use it in GitHub Desktop.
Pass in local browser names via command line `wdio --caps=chrome,firefox`
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
const argv = require('yargs').argv; | |
let capabilities = [ | |
{ | |
browserName: 'chrome', | |
}, | |
{ | |
browserName: 'firefox', | |
}, | |
{ | |
browserName: 'safari', | |
}, | |
]; | |
if (argv.caps) { | |
// dynamically build out the capabilities | |
const browsers = argv.caps.split(','); | |
capabilities = browsers.map(browserName => { | |
return {browserName}; | |
}); | |
} | |
const wdioConfig = { | |
... | |
capabilities, | |
... | |
} | |
exports.config = wdioConfig; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment