我跑黄瓜测试(使用Maven,在詹金斯)和输出失败场景的目标/ rerun.txt功能的文件夹,按照下列指示:https://github.com/cucumber/cucumber-jvm/issues/890Rerun.txt黄瓜是指classpath中,而不是
它创建rerun.txt并输入失败的场景,但将其输入为:features/name.feature:2。然后重新运行尝试将它们作为classpath/name.feature运行,但未能看到它们在src/test/resources/features中。
如果我将特征文件放在类路径中,我会得到不一致的过滤器错误(可能是因为我在第一个调用中使用了标记而第二个调用中使用了文本)。
如何让黄瓜输出功能的正确路径,或让它找到基于rerun.txt的功能?
错误:
Running com.xxx.cucumber._RunCukesTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.002 sec <<< FAILURE!
initializationError(com.xxx.cucumber._RunCukesTest) Time elapsed: 0 sec <<< ERROR!
java.lang.IllegalArgumentException: Neither found on file system or on classpath: Not a file or directory: classpath\SubFolder\Test1.feature,
No resource found for: classpath:SubFolder/Test1.feature
附加信息: 来测试所有初始呼叫是通过标签来完成。 所有功能位于classpath/src/test/resources/features中的子文件夹中 此测试必须每天自动运行在Jenkins中。
第一次运行时使用此:
@RunWith(Cucumber.class)
@CucumberOptions(
strict = false,
features={"src/test/resources/features/"},
snippets=SnippetType.CAMELCASE,
plugin = { "pretty", "json:target/cucumber-reports/test-report.json", "html:target/cucumber-reports",
"rerun:target/rerun.txt"})
public class RunCukesTest {
}
失败的情况下的第二次运行使用此:
@RunWith(Cucumber.class)
@CucumberOptions(
strict = false,
features={"@target/rerun.txt"},
snippets=SnippetType.CAMELCASE,
plugin = {"pretty", "json:target/cucumber-reports/test-report.json", "html:target/cucumber-reports"})
public class _RunCukesTest {
}