No commit activity in last 3 years
No release in over 3 years
Minitest reporter that automatically creates a screenshot on error or failure
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

MinitestScreenshotReporter

Gem Version Build Status Dependency Status Code Climate Coverage Status

Minitest reporter that automatically creates a screenshot on error or failure during capybara webtests. It works both in visible browser tests, as well as with headless tests.

Installation

Add this line to your application's Gemfile:

group :test do
  gem 'minitest-reporters'   
  gem 'minitest-screenshot-reporter'
  gem 'capybara'           # dsl for browser tests
  gem 'selenium-webdriver' # use real browser for webtests
  gem 'poltergeist'        # headless tests with phantom.js
end

And then execute:

$ bundle

Usage

Use as any other minitest reporter with `Minitest::Reporters.use!

Example: Add following to your test_helper.rb:

require 'minitest/reporters'
require 'minitest/reporters/screenshot_reporter'
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new,
                          Minitest::Reporters::ScreenshotReporter.new]

Run your tests, and if there are errors or failures in your integration tests, check the directory test/screenshots.

You can also include the Minitest::Reporters::Screenshot module to your integration test class. Than you can use the method screenshot(name) to explicitly create additional screenshots in test/screenshots in your integration tests.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

To release a new version, run bundle exec rake release_patch, bundle exec rake release_minor, oder bundle exec rake release_major, which will create a git tag for the version, push git commits and tags, and push the .gem file to https://rubygems.org.

Contributing

Bug reports and pull requests are welcome on github at https://github.com/igorj/minitest-screenshot-reporter.

License

The gem is available as open source under the terms of the MIT License.