문제

Instead of reading the feature file, writing the name of the methods, add the right annotations and variables I want to "compile" the feature file and generate the java test file automatically.

Is it possible? Do you know of a tool that can do that?

올바른 솔루션이 없습니다

다른 팁

If you run Cucumber-JVM it will generate snippets for each undefined step. You can cut and paste these into a class of your choosing.

Running inside IntelliJ you can use Alt-Return to generate a definition for a step. There are plugins for Eclipse that do this too, but I haven't used them recently.

you can set dryRun=true which should show you all missing steps.

@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
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top