Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute only one feature file in protractor by the use of a tag

I am trying to run just one feature file in protractor. I know that I can declare that file in protractor.conf.js, but I have also seen a solution by use of a tag:

In a feature file one would insert a tag at the beginning of the file like so:

@onlyRunThis

and protractor would only execute that file. (One could call it an E2E-equivalent of "fdescribe")

How would I implement such a tag? Can I even implement my own tags in protractor/cucumber? As you see I am quite sketchy on the whole matter.

I did find another question here on SO, which addresses the same issue (How to run only one feature file when running protractor with cucumber?) but none of the solutions work for me.

Thanks! :-)

like image 891
Tobias Gassmann Avatar asked Nov 22 '25 22:11

Tobias Gassmann


1 Answers

The above solution did not work for me. The following should work

protractor conf.js --cucumberOpts.tags="@onlyRunThis"

This will run all scenarios which have the tag @onlyRunThis set. When you add a tag to a feature then all scenarios inside it are run.

If you don't want to use tags for this you can call the command

protractor conf.js --specs=path/to/feature

Both work for me.

like image 183
sininen Avatar answered Nov 25 '25 17:11

sininen