Is there a command line option to list all the tags in your cucumber test suite?
For example, I would want something like:
cucumber --show-tags foo.feature
That would give me something like:
@ci
@development
@regression
@wip
We can define each scenario with a useful tag. Later, in the runner file, we can decide which specific tag (and so as the scenario(s)) we want Cucumber to execute. Tag starts with “@”. After “@” you can have any relevant text to define your tag.
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"}.
In Cucumber, tags are used to associate a test like smoke, regression etc. with a particular scenario.
Definition: Cucumber supports hooks, which are blocks of code that run before or after each scenario. You can define them anywhere in your project or step definition layers, using the methods @Before and @After. Cucumber Hooks allows us to better manage the code workflow and helps us to reduce code redundancy.
For a single file:
cucumber -f tag_cloud foo.feature
You could also find the tags of all features in a directory:
cucumber -f tag_cloud features/login
Or even features that are shared with a particular tag:
cucumber --format tag_cloud --tags @bvt
The output generated for all these is a wiki style table:
| @baseline | @customer | @demographics | @performance |
| 1 | 1 | 1 | 1 |
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