문제

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?

도움이 되었습니까?

해결책 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

다른 팁

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 {
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top