2014-02-16 41 views

回答

3

如果您运行Cucumber-JVM,它将为每个未定义的步骤生成片段。您可以剪切并粘贴到您选择的课程中。

在IntelliJ中运行,您可以使用Alt-Return为一个步骤生成定义。 Eclipse的插件也是这样做的,但我最近没有使用它们。

+0

谢谢!它不能在IntelliJ Community Edition中工作:(但是我可以运行测试并查看未定义的步骤,它只显示最后一步,是否有方法可以查看所有缺失的步骤? – bentzy

+0

对不起 - 在某些事情的中间。可以从命令提示符(它应打印出所有片段)尝试此操作:mvn clean test –

0

你可以设置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 
}