我知道您可以为特性指定标记,然后在命令行上运行cucumber时忽略它们。但我使用的是cucumber-jvm,并从maven运行它。@ignore不起作用,我不知道如何将要忽略的标记传递给执行小黄瓜测试的运行程序。
变通的方法是在开发和测试新特性的同时将完成的特性移动到另一个目录中,但这不应该是这样的。其他用户如何处理这一缺陷?
发布于 2013-10-03 08:28:57
您可以将您的场景标记为@ignore,它将被忽略。
如果您只想运行选择性的场景,那么将您想要测试的每个新特性标记为@new_test。告诉Cukes Runner仅运行标记= @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 {
}任何不想测试的东西都不应该有标签,或者应该有其他的标签名称
发布于 2014-05-20 21:43:16
你可以告诉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 {
}https://stackoverflow.com/questions/18893085
复制相似问题