![Monochrome in Cucumber](/sites/default/files/styles/wide/public/2023-12/rsz_1monochrome_-_false_2.png?itok=Rqq4HEy1)
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).
![monochrome = false in Cucumber](/sites/default/files/inline-images/rsz_mono1.jpg)
It will show a few unreadable characters in some console
![monochrome false in Cucumber](/sites/default/files/inline-images/rsz_1mono2.jpg)
monochrome = true in Cucumber
When monochrome is true:
It will print console output without color(s).
![monochrome true in Cucumber](/sites/default/files/inline-images/rsz_mono3.jpg)
It will not show a few unreadable characters in some console
![monochrome true in Cucumber](/sites/default/files/inline-images/rsz_1mono4.jpg)