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"},
Tag starts with “@”. After “@” you can have any relevant text to define your tag like @SmokeTests just above the scenarios you like to mark. Then to target these tagged scenarios just specify the tags names in the CucumberOptions as tags = {"@SmokeTests"}.
You can execute multiple scenarios in a single or multiple feature file by tagging Scenarios with common tags or grouping them using the rule keyword and tags. And Later, you can execute the scenarios by using that tag in the Cucumber Runner or Command line.
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
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With