Skip to content

Instantly share code, notes, and snippets.

@toolmantim
Created February 27, 2009 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toolmantim/71250 to your computer and use it in GitHub Desktop.
Save toolmantim/71250 to your computer and use it in GitHub Desktop.

Improving cucumber output

We want to reduce cucumber's signal to noise ratio--currently errors are hidden within pages and pages of success.

You don't care in detail about what has passed, simply that stories ran and passed. What you care about is which scenarios no longer work, have broken, need updating or aren't yet complete.

How it'll work

We don't show all the steps and a backtrace unless there's a problem.

If you want the full details you can use a --trace option.

To give feedback whilst running we show a status that sticks to the bottom of the terminal (similar to the pagination the 'more' command shows).

The status would look like:

Running features/login_logout.feature: Public home page > visiting the log in page

which is:

Running (feature file): (feature title) > (scenario title)

When a scenario fails we output the failure straight away to the output stream, above the status line.

After we finish running all the features we show a summary of pending steps, pending scenarios, failed scenarios and some totals.

Pending steps:
<copy and paste>

Pending scenarios:
  features/login_logout.feature: Logging in and logging out
    line 6   visiting the login page
    line 12  logging in with the correct email and password
    line 35  logging out

Failed scenarios:
  features/homepage.feature: The public homepage
    line 6   public viewer browsing the homepage

Summary:
  58 scenarios
  9 failed steps
  13 skipped steps
  2 undefined steps
  241 passed steps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment