Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Cucumber Cookbook

You're reading from   Cucumber Cookbook Over 35 hands-on recipes to efficiently master the art of behaviour-driven development using Cucumber-JVM

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785286001
Length 162 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Shankar Garg Shankar Garg
Author Profile Icon Shankar Garg
Shankar Garg
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Cucumber Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Writing Feature Files FREE CHAPTER 2. Creating Step Definitions 3. Enabling Fixtures 4. Configuring Cucumber 5. Running Cucumber 6. Building Cucumber Frameworks 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images