Overriding tags to be filtered using command line through Gradle #2239
-
I'm tying to override the configuration for which tags to run from the Gradle command line. Following Java class is used to setup Cucumber:
This is my relevant Gradle setup using the Test Suite concept:
I have scenarios tagged with When I run Now I want to execute only the sunny flows, so I call: Any thoughts where I am missing something? Using Java 17, Gradle 8.13, Cucumber 7.21 Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The JUnit annotation You'd have to remove the annotation and configure Gradle to use a default value for I'm far from a Gradle expert so don't know how to do that. |
Beta Was this translation helpful? Give feedback.
Thanks, that was a helpful detail.
I updated the build.gradle file, it now has this definition:
This will use the system property
cucumber_filter_tags
when present and otherwise default to"not @ignore and not @wip"
.I renamed the system property to
cucumber_filter_tags
because it seems that it is not possible to specify dot-separated properties from the command line. Well, I didn't get it to work.Now the call is done through
./gradlew bddTest -Dcucumber_filter_tags="@SunnyFlow"
to run only the scenarios with tag@SunnyFlow
.All works like a charm.