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