0.0
The project is in a healthy, maintained state
Automatically record videos when tests failed.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Project Readme

TestRecorder

Record a video automatically when tests failed. The videos are generated in tmp/videos directory.

Build Status Gem Version

This gem was inspired by Record video feature of Playwright.

Requirements

This gem depends on FFmpeg. Please install that package.

On Debian/Ubuntu:

sudo apt-get install ffmpeg

Supported libraries

Rails system tests and RSpec(System Spec and Feature Spec).

Limitations

Currently, this gem only supports a Headless Chrome.

Usage

1: Install the gem

Using Bundler, add the following to your Gemfile:

gem 'test-recorder', group: :test

2: Load library into your tests

Rails

require 'test_recorder/rails'

RSpec

require 'test_recorder/rspec'

Only record specific tests

TestRecorder records all tests by default. But if you want to limit the tests, you can do it by specifying metadata.

Rails

1: Install the additional Gem

Using Bundler, add the following to your Gemfile:

gem 'activesupport-testing-metadata', group: :test
2. Disable TestRecorder, and specified tests with the tag
# test/test_helper.rb
require 'test_recorder/rails'
require 'active_support/testing/metadata'

TestRecorder.disable!
test "test to something", test_recorder: true do
  # ...
end

RSpec

You don't need to install other gems. Only disable TestRecorder, and specified tests with the tag.

# test/test_helper.rb
require 'test_recorder/rspec'

TestRecorder.disable!
it "test to something", test_recorder: true do
  # ...
end