Table of Contents
- What is Monochrome in Cucumber
- Monochrome Method Signature
- Monochrome in Cucumber Options
- monochrome = false in Cucumber
- monochrome = true in Cucumber
- Video Tutorial
What is Monochrome in Cucumber
In Cucumber, we use a monochrome as a cucumber option to determine whether the output should be colorful. In another case, it is also used to make output more readable.
Monochrome method signature
/**
* @return true if terminal output should be without colours.
*/
boolean monochrome() default false;
Monochrome in cucumber options
@CucumberOptions(
plugin = {"pretty", "html:target/cucumber"},
features = {"src/test/resources/features"},
glue={"com.teststep.demo"},
monochrome = false
)
monochrome = false in Cucumber
monochrome is false by default. When it is false:
It will print console output with color(s).
It will show a few unreadable characters in some console
monochrome = true in Cucumber
When monochrome is true:
It will print console output without color(s).
It will not show a few unreadable characters in some console