how to input --cucumberOpts.tags with multiple tags with And relationship
Equivalent in conf.js file will look like:
cucumberOpts: { tags: ['@dev', '~@ignore'] }
I am trying something like --cucumberOpts.tags="@dev&&~@ignore" or --cucumberOpts.tags="['@dev','~@ignore']" None of it seems to work. Do we support multiple tags input from commandline?
You can use the --cucumberOpts.tags option multiple times, for instance:
protractor protractorConf.js --cucumberOpts.tags="@dev" --cucumberOpts.tags="~@ignore"
that is very helpful. I am trying to drive it from grunt. When I do grunt.option('cucumberOpts', '@dev'); grunt.option('cucumberOpts', '~@ignore');
The second option overrides the first. Any grunt expert here?
On Wed, Aug 13, 2014 at 8:25 AM, Lukas Svoboda [email protected] wrote:
You can use the --cucumberOpts.tags option multiple times, for instance:
protractor protractorConf.js --cucumberOpts.tags="@dev" --cucumberOpts.tags="~@ignore"
— Reply to this email directly or view it on GitHub https://github.com/angular/protractor/issues/1180#issuecomment-52041105.
I think this is now a grunt question, so I'm going to close. Please ask on stack overflow or a more appropriate grunt forum. Thanks!
just stumbled on this. The OP is encountering a grunt bug which is fixed in grunt 1.X , which was released a couple months ago. HTH
see closed issue here : https://github.com/gruntjs/grunt/issues/488
Since this is the first relevant google hit for the subject and I have a feeling myself or someone else might end up here in the future:
This is what I'm ended up using doing with an integration-test grunt registered task, where I'm setting a bunch of process.env and passing the values to the grunt-protractor-runner module with my CLI input as grunt integration-test -tags=@wip,@kian. Note that from what I can tell before diving further that the grunt-protractor-runner is using AND logic on the CLI passed in tags, so it works great if you want to AND NOT (@kian,~@wip), but isnt great for IN/LIKE logic.
//$ grunt integration-test -tags=@wip,@kian
//Collect tags from CLI or specify elsewise.
if(grunt.option('tags') != undefined) cukeTags = grunt.option('tags');
else cukeTags = false;
//Throw tags into an array if they exist and aren't an array.
if (!Array(cukeTags) && cukeTags != false && cukeTags != undefined && cukeTags.includes(',')) cukeTags = cukeTags.split(',');
//Set tags for grunt-protractor-runner to consume
grunt.config.merge({protractor: {options: {args: {cucumberOpts: {tags: cukeTags} }}}});
//Run protractor based off standard grunt-protractor-runner task config.
grunt.task.run(['protractor:e2e']);