Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run only one feature file when running protractor with cucumber?

I have multiple feature files and I would really love to run just one file or just one scenario or just one tag. I know I could just provide one file in my specs in my cucumberConf.js, but I would like to run it once without fiddling with my cucumberConf.js. Which arguments do I need to type in when running protractor?

like image 571
Capaj Avatar asked Dec 20 '22 12:12

Capaj


2 Answers

in protractor's config:

cucumberOpts: {
...
        tags: [
        "@runThis",
        "@runThat",
        "~@ignoreThis"
    ];
...
},

in the feature file

    @runThis
    Scenario: Run this Scenario
        Given user does some action
        Then something should happen

    @ignoreThis
    Scenario: ignore this Scenario
        Given user does some action
        Then something should happen
like image 65
mojjj Avatar answered Jan 04 '23 23:01

mojjj


The easiest way to do this would be to use the --specs option.

protractor --specs=specs/testA.js e2e-conf.js

like image 25
rjferguson21 Avatar answered Jan 04 '23 22:01

rjferguson21