# frozen_string_literal: true require 'capybara-screenshot/rspec' ::Capybara::Screenshot.autosave_on_failure = true ::Capybara::Screenshot.prune_strategy = :keep_last_run ::Capybara::Screenshot::RSpec.add_link_to_screenshot_for_failed_examples = false ::Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example| example.full_description.downcase.tr(' ', '-').gsub(%r{^.*/spec/}, '') end ::Capybara::Screenshot.register_driver(:chrome) { |driver, path| driver.browser.save_screenshot(path) } ::Capybara::Screenshot.register_driver(:headless_chrome) { |driver, path| driver.browser.save_screenshot(path) } ::Capybara::Screenshot.register_driver(:firefox) { |driver, path| driver.browser.save_screenshot(path) } ::Capybara::Screenshot.register_driver(:headless_firefox) { |driver, path| driver.browser.save_screenshot(path) }