Directing the Cucumber output to a file

Cucumber integrates business logic with code, so our focus is on business rather than code. The same philosophy is also followed in the Cucumber reports. Cucumber reports are more about business utility rather than to do with more charts.

Robust automation frameworks generate very good and detailed reports, which can be shared with all stake holders. There are multiple options available for reports which can be used depending on the requirement. Let's check out how to use reports extensively in our next section.

How to do it…

  1. For HTML reports, add html:target/Cucumber to the @CucumberOptions plugin option. This is what the code for @CucumberOptions looks like:
    @CucumberOptions( Features = "src/test/java/com/Features", ...

Get Cucumber Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.