Question

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?

Was it helpful?

Solution 2

You can tag your scenarios as @ignore which will be ignored.

If you want to run only selective scenarios then mark your every new feature that you want to test as @new_test. Tell the Cukes Runner to run only tags = @new_test

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

@RunWith(Cucumber.class)
@Cucumber.Options(features = {"classpath:my_feature.feature"},
tags = {"@new_test"})
public class RunCukesTest {

}

Anything that you don't want to test should not have a tag or should have some other tag name

OTHER TIPS

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 {
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top