5

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?

Capaj
  • 4,024
  • 2
  • 43
  • 56

3 Answers3

7

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
mojjj
  • 625
  • 8
  • 18
5

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

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

rjferguson21
  • 1,004
  • 5
  • 9
2

use the specs array in protractor config file. E.g.

specs: [ 'test/features/xxx.feature' ],
user3869623
  • 2,363
  • 2
  • 15
  • 19