How to run a single .feature file in a Playwright + Cucumber automation testing framework?

2.6k views Asked by At

I create Automation testing framework with Playwright + Cucumber.js written in Javascript language. Everytime I type npm run test in the Console all the Cucumber scenarios (.feature files) are ran. But how can I run only one .feature scenario? Is there a command for this?

It would be really nice if you give me a tip how to run tests with tags, too.

I tried to run different commands but didn't succeed in running a single .feature test.

I tried to run tests with tags, but couldn't do it.

1

There are 1 answers

0
Daniel Hudač On

Sure you can, for running one feature it`s

npm run test <FullPathOfFeature>.feature

For running even only one scenario in feature it`s

npm run test <FullPathOfFeature>.feature:<LineOfCodeWhereScenarioIsDefined>