1

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.

2
  • If you have a cucumber config file setup you can specify the feature file you want to run there Commented Sep 16, 2022 at 17:50
  • Please provide enough code so others can better understand or reproduce the problem. Commented Sep 18, 2022 at 4:45

3 Answers 3

1

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>

Sign up to request clarification or add additional context in comments.

Comments

0
Npm run test -- -- tags=yourtag

Comments

0

You can add your specific feature file path in the cucumber.json file that you created after installation then run the command

It will works

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.