Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Automatically save screen shots when a Cucumber Capybara scenario fails

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore Initial commit
Octocat-spinner-32 CHANGELOG.md
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE Documentation
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile Initial commit
Octocat-spinner-32 capybara-screenshot.gemspec
README.md

capybara-screenshot gem

Using this gem, whenever a capybara cucumber scenario fails, the HTML for the failed page and a screenshot (when using capybara-webkit) is saved into /tmp/capybara.

This is a huge help when trying to diagnose a problem in your failing steps as you can view the source code and potentially how the page looked at the time of the failure.

Usage

gem install capybara-screenshot

or update your Gemfile to include:

group :test do
  gem 'capybara-screenshot'
end

That's it!

Example application

A simple Rails 3.1 example application has been set up at https://github.com/mattheworiordan/capybara-screenshot-test-rails-3.1 Git clone the app, and then run Cucumber rake cucumber or RSpec rspec spec/**/*_spec.rb and expect failures. Then check the tmp/capybara folder for the automatic screen shots generated from failed tests.

Repository

Please fork, submit patches or feedback at https://github.com/mattheworiordan/capybara-screenshot

The gem details on RubyGems.org can be found at https://rubygems.org/gems/capybara-screenshot

About

This gem was written by Matthew O'Riordan

License

Copyright © 2011 Matthew O'Riordan, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.

Something went wrong with that request. Please try again.