我正在使用 cucumber-junit 项目运行自动化测试,我的项目中有大约 200 个场景。现在的问题是,很难在我的项目中找到未使用的步骤定义,因为我们不断需要更新功能。 .是否有任何解决方案来检测不再有用的步骤定义..非常感谢任何帮助!!
最佳答案
自 cucumber-jvm 4.4.0 起,可以使用内置插件的 cucumber-jvm - 未使用。
对于 Cucumber junit runner 来说,它可能看起来像这样:
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {
"json:build/report/cucumber.json",
"unused:build/report/usage.txt"} //mind this plugin
glue = "stepdefs",
features = "features"
)
public class CucumberRunner {
}
运行后,应在build/report/usage.txt中找到未使用的stepdefs
关于java - 如何检测 cucumber-jvm junit 项目中未使用的步骤定义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37550555/