ENV["RAILS_ENV"] ||= "test" require_relative "../config/environment" require "rails/test_help" require "minitest/mock" class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all include Warden::Test::Helpers Warden.test_mode! # Add more helper methods to be used by all tests here... end Capybara.register_driver :headless_chrome do |app| capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( "chromeOptions" => { args: %w[headless disable-gpu] + ["window-size=1280,800"] }, ) Capybara::Selenium::Driver.new app, browser: :chrome, desired_capabilities: capabilities end Capybara.save_path = Rails.root.join("tmp/capybara") Capybara.javascript_driver = :headless_chrome