Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ignoring features in cucumber-jvm

Tags:

cucumber-jvm

I know you can specify tags for features and then ignore them when running cucumber on the command line. But I'm using cucumber-jvm and running it from maven. @ignore doesn't work and I wouldn't know how to pass the to-be-ignored tags to the runner that executes the Gherkin tests.

The work-around is to move feature that are done to another directory while developing and testing new ones, but that's not how it should be. How do other users deal with this deficiency?

like image 437
Cpt. Senkfuss Avatar asked Sep 19 '13 11:09

Cpt. Senkfuss


People also ask

How do you ignore scenario in feature file in Cucumber?

You can ignore Cucumber Tests using tags. not word is used along with tags to ignore the test. This works both for the Scenario as well as the Feature. You can skip a scenario, set of scenarios, or all scenarios in a feature file.

Why is the Cucumber test ignored?

"If Cucumber is telling you that your steps are undefined, when you have defined step definitions, this means that Cucumber cannot find your step definitions. You'll need to make sure to specify the path to your step definitions (glue path) correctly. (Sidenote: you are using a very old version of Cucumber.

How do you run only selected scenarios in Cucumber?

You can either use selective feature file or selective scenarios in the feature using tags. Please try with this solution. Lets consider the you have n number of feature files and you need to run only selective feature from that. Then name each feature file with @tag name.


1 Answers

You can tell runner skip @ignore

import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@Cucumber.Options(features = {"classpath:my_feature.feature"},
tags = {"~@ignore"})
public class RunCukesTest {
}
like image 147
talex Avatar answered Oct 21 '22 11:10

talex