Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cucumber-helper

Two things that make a Cucumber suite easier to live with: a progress bar instead of a wall of dots, and a check that fails a step the moment an error appears on the page rather than three steps later.

Written in 2013, for Cucumber and Capybara of that era.

The progress bar

Cucumber's own progress formatter prints a dot per step and keeps its failures until the end. This one draws a real progress bar with a count and an estimate, and prints each failure the moment it happens, so you can stop a bad run instead of waiting for it.

Counting the steps correctly is most of the work: scenario outlines multiply by the number of example rows, and a background runs once per scenario.

Use it with:

$ cucumber --format cuckebar

Failing on the error the moment it appears

In a web suite the usual failure is not the assertion. It is that the page threw an error five steps ago and everything since has been running against a broken page, so the failure surfaces somewhere unrelated to its cause.

Tell the helper what an error page looks like:

Cucumber::Helper.configure do |config|
  config.error_message = "We are sorry, but something went wrong"
end

After that, every click_link, click_button, visit, execute_script and every element.click checks the page for that text and fails there and then.

Installation

The gem was never pushed to RubyGems. Add it from git:

gem 'cucumber-helper', git: 'https://github.com/AlexKlim/cucumber-helper.git'

Status

Not maintained. It depends on Capybara 1.1 and reaches into Cucumber's internal AST, neither of which exists in that form any more, so it will not run against current versions without changes. It is here as it was written.

Contributing

Fork it, make a branch, send a pull request.

About

A Cucumber progress bar that prints failures as they happen, plus a check that fails a step the moment an error page appears. Ruby, 2013.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages