Closed worc closed 5 years ago
I don't think this is specific to the cucumber service, as I'm getting this in my wdio project (I'm using the mocha service)
I posted this in the WebdriverIO Gitter:
The below works as expected, the baseUrl in my config is replaced by whatever I use in CLI.
./node_modules/.bin/wdio config/desktop.conf.js --baseUrl https://www.google.co.uk
But if I have a script in my package.json that is:
"test:desktop": "./node_modules/.bin/wdio config/desktop.conf.js"
And I write the below in terminal, it errors mentioning multiple config files being used.
npm run test:desktop --baseUrl https://www.google.co.uk
More than one config file was specified: config/desktop.conf.js, https://www.google.co.uk
Error: You can only run one wdio config file!
Is this a bug or expected behaviour? I'm more than happy to raise this as an issue.
@PFaz540 When using npm run you need to specify --
before you start your argument list.
e.g.
npm run test:desktop -- --baseUrl https://www.google.co.uk
this should still be open. this is a bug with yarn not npm... :/
this is a bug with yarn not npm... :/
Why is this a bug with yarn? And even if it would be why should this still be open then?
This also seems to happen if you do:
wdio --spec test/*.js mocha.wdio.conf.js
So I don't think it's anything to do with Yarn or NPM.
The issue here is that your shell is expanding the glob, not wdio. Try quoting your string:
yarn run wdio ./wdio.conf.js --spec './src/**/*.feature'
https://medium.com/@jakubsynowiec/you-should-always-quote-your-globs-in-npm-scripts-621887a2a784
Does the --spec cli option support globs?
if i set a globbed spec
./src/**/*.feature
in the config file or specify a single file through the cli./src/login.feature
tests run just fine:or
but if i use a glob in the cli option, the glob expands correctly, but the cli prints its help menu and then throws an unrelated error: