Monochrome in Cucumber

Monochrome in Cucumber

Table of Contents

  1. What is Monochrome in Cucumber
  2. Monochrome Method Signature
  3. Monochrome in Cucumber Options
  4. monochrome = false in Cucumber
  5. monochrome = true in Cucumber
  6. 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

It will show a few unreadable characters in some console

monochrome false in Cucumber

monochrome = true in Cucumber

When monochrome is true:

It will print console output without color(s).

monochrome true in Cucumber

It will not show a few unreadable characters in some console

monochrome true in Cucumber

Video Tutorial: Monochrome in Cucumber

Managed ad


Tarun Goswami
Tarun possesses over 12+ years of extensive expertise in software testing and automation utilizing diverse JavaScript and Java technologies. Concurrently, he has dedicated his free time to crafting insightful blogs within the field.