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

Configuring the Cucumber Console output


When we execute Cucumber Scenarios, it generates an output to the terminal or the eclipse console. There is a default behavior associated with that output and we can also configure that output as per our needs also. So how do we modify the default behavior, let's see this in the next section.

How to do it…

  1. Add the plugin option to @CucumberOptions and set its value to {"progress"}. This is how the @CucumberOptions code looks like:

    @CucumberOptions(  
        Features = "src/test/java/com/Features",
        glue = "com.StepDefinitions",
        Tags = { "~@wip","~@notImplemented","@sanity" },
        dryRun = false,
        strict = true,
        monochrome = true,
        plugin = { "progress" }
        )
  2. If we run the Scenarios now via the Terminal, this is what our output looks like:

  3. Instead of the progress plugin, we can also use the pretty plugin, which is more verbose as compared to the progress plugin. This is what the code looks like:

    @CucumberOptions(  
      Features = "src/test/java...