Record a video automatically when tests failed. The videos are generated in tmp/videos
directory.
This gem was inspired by Record video feature of Playwright.
This gem depends on FFmpeg. Please install that package.
On Debian/Ubuntu:
sudo apt-get install ffmpeg
Rails system tests and RSpec(System Spec and Feature Spec).
Currently, this gem only supports a Headless Chrome.
Using Bundler, add the following to your Gemfile:
gem 'test-recorder', group: :test
require 'test_recorder/rails'
require 'test_recorder/rspec'
TestRecorder
records all tests by default. But if you want to limit the tests, you can do it by specifying metadata.
Using Bundler, add the following to your Gemfile:
gem 'activesupport-testing-metadata', group: :test
# test/test_helper.rb
require 'test_recorder/rails'
require 'active_support/testing/metadata'
TestRecorder.disable!
test "test to something", test_recorder: true do
# ...
end
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