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

Running Strict and Running Dry


When a Cucumber project becomes big, it becomes very important that we keep the integrity of the system intact. It should not happen that the addition/modification of Scenarios is breaking the system. So, how to quickly check whether all the Steps have an associated Step Definition defined (without executing the code in those Step Definitions)? Let's understand that in our upcoming section.

How to do it…

  1. Add the dryRun option to @CucumberOptions and set its value to true.

  2. Add the strict option to @CucumberOptions and set its value to false.

  3. Add the monochrome option to @CucumberOptions and set its value to true.

This is how our RunCukeTest.Java class should look like:

package com.CucumberOptions;

import org.junit.runner.RunWith;
import Cucumber.api.CucumberOptions;
import Cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(  
    Features = "src/test/java/com/Features",
    glue = "com.StepDefinitions",
    Tags = { "~@wip","~@notImplemented...