Pages

What is monochrome in Cucumber?

What is monochrome in Cucumber?

monochrome:
  • In cucumber, monochrome is used to display console output in color format or not.
It will take 2 values:

False: 
  • Its default value is false.
  • It will print console output with color(s).
True:
  • It will print console output without color(s).
Demo on cucumber monochrome:

Let's say we have created a feature file with a scenario like below:

FirstFeatureFile.feature:
Feature: Demo on cucumber framework
  Description: The purpose of this feature is explain feature file

  Scenario: This is my First Scenario
    Given I landed on Home Page
    When I see title
    And I click signin button
    Then I should navigate to signin page
I will run above cucumber scenario by using Runner class file with monochrome=false like below:
monochrome-cucumber
Cucumber-monochrome



Run above cucumber scenario by using Runner class file with monochrome=true
monochrome-cucumber
Cucumber-monochrome

Please comment below to feedback or ask questions.

No comments:

Post a Comment

Please comment below to feedback or ask questions.