Book Image

Cucumber Cookbook

By : Shankar Garg
Book Image

Cucumber Cookbook

By: Shankar Garg

Overview of this book

Table of Contents (13 chapters)
Cucumber Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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",
        glue = "com.StepDefinitions",
        Tags = { "~@wip","~@notImplemented","@sanity" },
        dryRun = false,
        strict = true,
        monochrome = true,
        plugin = { "progress",
              "html:target/Cucumber"
            }
        )
  2. For JSON...