Skip to content

Instantly share code, notes, and snippets.

@klamping
Last active June 28, 2018 21:16
Show Gist options
  • Save klamping/da24f00fec653cb489137dbdbc1ffe40 to your computer and use it in GitHub Desktop.
Save klamping/da24f00fec653cb489137dbdbc1ffe40 to your computer and use it in GitHub Desktop.
Pass in local browser names via command line `wdio --caps=chrome,firefox`
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