question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CucumberOptions: Tags and name do not work well together

See original GitHub issue

If I only set tags in cucumberOptions, it can filter which scenarios match the tags will be executed. If I only set name in cucumberOptions, it also can filter which scenarios match the name will be executed. if I only set feature path and scenario lines, it also can filter which scenario match the line will be executed

if I both set tags and name (or scenario line), nothing will be executed with output “Test Ignored”, I expected it can filter by both tags and scenario name.

Here is my cucumber options.

@CucumberOptions(strict = true,
    features = {"classpath:features/F00001.feature"},
    format = {"json:cuccumber.json", "pretty"},
    monochrome = true,
    tags = {"~@manual", "~@deprecated", "~@todo", "~@wip", "~@ignore"},
    glue = { "org.some.steps" },
    name = {"^Verify what I expected$"})

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
brasmussoncommented, Mar 26, 2016

Specifying tags, specifying (scenario) name, and specifying feature path and line are three different way of specifying which scenarios to execute. You can only use one of them at the time.

1reaction
tcwmjcommented, Mar 26, 2016

Thanks, I expect “tags and names”, but someone might prefer “tags or names”, so the default FilterFormatter keeps a single filter…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cucumber Tags - Tools QA
Note: There are only two scenarios in our feature file which have both tags together.
Read more >
CucumberOptions tag is being ignored when @Suite Junit is ...
You can not use @CucumberOptions in combination with @Suite . The former is used for JUnit 4, the latter part of JUnit 5....
Read more >
Cucumber Reference - Cucumber Documentation
Ignoring a subset of scenarios. You can tell Cucumber to ignore scenarios with a particular tag: Using JUnit runner class: @CucumberOptions(tags = "not...
Read more >
How to Get the Most Out of Cucumber Tags - Coveros
First each directory of feature files is run alphabetically, then each feature file alphabetically from the directory, and then each scenario in ...
Read more >
TUTORIAL 3 :Using Tags in Cucumber - Knoldus Blogs
Hello Everyone, Now We will go through the TAGS in cucumber. ... Along with this, we can still tag a single scenarios as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found