Question

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?

No correct solution

OTHER TIPS

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
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top