不是读取特征文件,写入方法的名称,而是添加正确的注释和变量,以便“编译”特征文件并自动生成java测试文件。
有可能吗?你知道有什么工具可以做到这一点吗?
发布于 2014-02-18 17:39:35
如果您运行Cucumber-JVM,它将为每个未定义的步骤生成代码片段。您可以将这些内容剪切并粘贴到您选择的类中。
在IntelliJ中运行时,您可以使用Alt-Return组合键为步骤生成定义。Eclipse的插件也可以做到这一点,但我最近没有使用过它们。
发布于 2014-02-19 17:32:26
您可以设置dryRun=true,它将显示所有缺少的步骤。
@RunWith(Cucumber.class)
@CucumberOptions( monochrome = true,
tags = "@tags",
features = "src/test/resources/features/",
format = { "pretty","html: cucumber-html-reports",
"json: cucumber-html-reports/cucumber.json" },
dryRun = true,
glue = "glue_code_folder" )
public class RunCucumber_Test {
//Run this
}https://stackoverflow.com/questions/21814256
复制相似问题