Search code examples
javamavencucumbercucumber-jvmcucumber-junit

Cucumber Java - JUnit set monochrome over command line


What is the best way to disable color output for my Cucumber JUnit tests when they are run by a build machine?
It is possible to set monochrome = true in the @CucumberOptions annotation. The problem with that is, running the Tests locally should contain Color.

Setting -Dcucumber.options.monochrome=true is not working, for whatever reason.

Is there any way to set/override this from the command line?


Solution

  • Found the solution.
    As stated here https://cucumber.io/docs/cucumber/api/#list-configuration-options
    Providing -Dcucumber.ansi-colors.disabled=true solves the issue.