Is it possible to generate test Java stub files from a cucumber cucumber function file?

Instead of reading the function file, writing down the name of the methods, add the correct annotations and variables that I want to "compile" the function file and automatically create a test java file.

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

+4
source share
2 answers

If you run Cucumber-JVM, it will generate fragments for each step undefined. You can cut and paste them into the class of your choice.

IntelliJ Alt-Return . Eclipse, , .

+3

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
}
0

Source: https://habr.com/ru/post/1527207/


All Articles