RSpec Pretty HTML Reporter
Produce pretty RSpec reports.
This is a custom reporter for RSpec which generates pretty HTML reports showing the results of rspec tests. It has features to embed images and videos into the report providing better debugging information when a test fails.
Setup
Add this to your Gemfile:
gem 'rspec_pretty_html_reporter'
Generating the report
Either add the below into your .rspec
file
--format RspecPrettyHtmlReporter
or run RSpec with --format RspecPrettyHtmlReporter
like below:
REPORT_PATH=reports/$(date +%s) bundle exec rspec --format RspecPrettyHtmlReporter spec
This will create the reports in the reports
directory.
Usage
Images and videos can be embed by adding their path into example's metadata. For an example of how to do this, please check out this Sample Test.
Themes
Yeti is the default theme for the report, however you can change the theme by using the environment
variable THEME=cerulean
in the terminal before you execute your tests. The example below illustrates how to use this
variable with your tests:
THEME=sketchy bundle exec rspec
The included themes you can choose from are:
- cerulean
- litera
- materia
- sketchy
- spacelab
Credits
This library is forked from vbanthia/rspec_html_reporter. The original credit goes to kingsleyh for kingsleyh/rspec_reports_formatter