Reputation: 505
I have multiple scenarios listed in a feature file and I need to run only a single failing scenario (for debugging purposes).
I have mentioned @tag before the scenario but while in Test Runner file when given this tag it is running entire feature file. Please help me out how to put it correctly.
TEST Runner file -
tags={"@Islamic_User_check"},
Upvotes: 30
Views: 97966
Reputation: 4963
If you use IntelliJ then I suggest installing the Cucumber for Java plugin.
Then you can right-click on the Test
annotation in the feature
file and run that single test scenario.
Upvotes: 16
Reputation: 379
Use the --name REGEXP
command line argument to run only the scenarios that match the regular expression REGEXP:
cucumber --name "Islamic_User_check"
Upvotes: 4
Reputation: 2167
Update: there is now a tags options
cucumber --tags @tagname
In maven:
mvn test -Dcucumber.options="--tags @tagname"
(and in Windows powershell escape the -D with a backtick)
mvn test `-Dcucumber.options="--tags @tagname"
Upvotes: 24
Reputation: 743
If you want to run a specific scenario using cucumber you need to provide the line number the scenario starts on like:
cucumber features/test.feature:7
if you use the @ feature it should point to a txt file where the line number is still given.
Source: https://www.relishapp.com/cucumber/cucumber/docs/cli/run-specific-scenarios
Hope this helps
Upvotes: 36