Formatting options for test output
Cucumber gives you a couple of options for result formatting.
- HTML
- JSON
We will add both for our tests.
Consider the following code for result formatting.
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/java/features/",
format = {"pretty", "html:target/cucumber", "json:target/cucumber-report.json"})
public class RunCukesTest {
}
Running the same tests would now produce an html result and also a json output. You can see the same in the target folder inside your project.