我正在尝试将我的黄瓜测试从cucumber-junit迁移到cucumber-junit-platform-engine,以便能够使用新的平台特性。如何重新定义我的跑步者以使用旧的@CucumberOptions。我正在调查这个问题,但似乎还找不到合适的方法。
在我使用这些选项之前:
@CucumberOptions(
plugin = ...,
features = ...,
tags = ...,
glue = ...
)是否有一种将其直接迁移到平台引擎的方法?
发布于 2021-11-26 19:13:31
在过去的几天里,我一直在调查JUnit5和Cucumber 7.0,我只是想补充一下你自己的答案。文档是稀缺的,这个链接一直是一个祝福和文档
您不必使用@IncludeEngines也要注意如何引用包
@Suite
@SelectClasspathResource("com/rmdaw/cucumber/features")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "com.rmdaw.repository")最后一件可以将配置放置到test/java/resources/junit-platform.properties中的东西是这样的:
cucumber.publish.quiet=true
cucumber.glue=com.rmdaw.cucumber
cucumber.plugin=pretty,\
html:target/SystemTestReports/report.html,\
json:target/SystemTestReports/report.json,\
junit:target/SystemTestReports/junit.xml\ 发布于 2020-10-29 20:23:43
在6月5日/#2416被合并之前,没有1比1的替换。但是,如果只有一个带有@CucumberOptions注释的类,那么向junit-platform.properties添加属性就足够了。
编辑:#2416被合并并发布。您现在可以使用套件运行不同配置的黄瓜。见黄瓜-junit-平台文档。
发布于 2021-11-24 09:12:53
看起来应该使用带有适当引擎的@Suite,而不是黄瓜注释。
@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("features")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "com.example")
public class RunCucumberTest {
}@spmason 回答。
https://stackoverflow.com/questions/64587739
复制相似问题