-
Notifications
You must be signed in to change notification settings - Fork 0
Console Colours
The console output for Cucumber colours steps according to how execution went. In addition to that, matched step variables are highlighted. Here is an example of how a single step gets printed:
Given I have 487 cucumbers in my belly # features/vegetable_features.feature:49
From version 0.1.13 and up uou can tweak the colours by defining a $CUCUMBER_COLORS variable in your shell, very much like you can tweak the colours of the familiar POSIX command ls with
$LSCOLORS or $LS_COLORS.
The colours that you can change are:
| Key | Default colours | |||
| pending | yellow | |||
| pending_param | yellow,bold | |||
| failed | red | |||
| failed_param | red,bold | |||
| passed | green | |||
| passed_param | green,bold | |||
| skipped | cyan | |||
| skipped_param | cyan,bold | |||
| comment | grey | |||
| tag | blue |
For instance, if your shell has a black background and a green font (like the
“Homebrew” settings for OS X’ Terminal.app), you may want to override passed
steps to be white instead of green. Examples:
export CUCUMBER_COLORS="passed=white" export CUCUMBER_COLORS="passed=white,bold:passed_param=white,bold,underline"
(If you’re on Windows, use SET instead of export).
To see what colours and effects are available, just run this in your shell:
ruby -e "require 'rubygems'; require 'term/ansicolor'; puts Term::ANSIColor.attributes"
Although not listed in the output, you can also use grey.