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…
- Add the
dryRun
option to@CucumberOptions
and set its value totrue
. - Add the
strict
option to@CucumberOptions
and set its value tofalse
. - Add the
monochrome
option to@CucumberOptions
and set its value totrue
.
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...