Serenity Maven Cucumber - Only run specific scenarios

Problem: While using the serenity cucumber framework with maven run only specific scenarios or feature files

Solution: To run only individual feature, run a specific tag say @wip

Work In Progress tag @wip

mvn verify -Dcucumber.options="--tags @wip"

mvn verify -Dcucumber.options="--tags @wip @debug2"

More -DCucumber.options here:

You can also do this by creating test runner class for each .feature file:
@CucumberOptions(features = "src/test/resources/features/search/search_by_keyword.feature")
public class SearchByKeyword {
Triggering this as any other test class, would execute only the SearchByKeyword.feature.


Popular posts from this blog

Trim / Remove spaces in Xpath?

Complete list of Serenity properties

XPATH for IE / internet explorer