Changing Formatters

We think it’s starting to get distracting looking at the whole content of the feature in Cucumber’s output each time we run. Let’s switch to the progress formatter to get a more focused output. Run this command:

 
$ ​cucumber --format progress

You should see the following output:

 
.ruby: No such file or directory -- calc.rb (LoadError)
 
F-
 
 
(::) failed steps (::)
 
 
Command failed! (RuntimeError)
 
./features/step_definitions/calculator_steps.rb:10
 
features/adding.feature:5
 
 
Failing Scenarios:
 
cucumber features/adding.feature:3 # Scenario: Add two numbers
 
 
1 scenario (1 failed)
 
3 steps (1 failed, 1 skipped, 1 passed)
 
0m0.021s

Instead of printing the whole feature, the progress formatter has printed three characters ...

Get The Cucumber Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.