Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all available tags in Cucumber

Tags:

cucumber

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
like image 332
kerkeslager Avatar asked Nov 11 '10 20:11

kerkeslager


People also ask

What are the tags available in Cucumber?

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.

How do you run all tags in Cucumber?

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"}.

What are the Cucumber tags how they can be used?

In Cucumber, tags are used to associate a test like smoke, regression etc. with a particular scenario.

What are tags & hooks in Cucumber?

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.


1 Answers

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            |
like image 122
burtlo Avatar answered Sep 21 '22 12:09

burtlo