require 'capybara/rspec' require 'capybara-screenshot' require 'capybara-screenshot/rspec' require 'capybara/rails' require 'selenium-webdriver' require 'capybara-select-2' RSpec.configure do |config| Capybara.register_driver :chrome do |app| Selenium::WebDriver.logger.level = :error Capybara::Selenium::Driver.new app, browser: :chrome, options: Selenium::WebDriver::Chrome::Options.new( args: %w[no-sandbox disable-dev-shm-usage disable-popup-blocking headless disable-gpu window-size=1920,1080 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=VizDisplayCompositor], log_level: :error ) end Capybara.javascript_driver = :chrome Capybara::Screenshot.register_driver(:chrome) do |driver, path| driver.browser.save_screenshot(path) end config.include CapybaraSelect2 config.include CapybaraSelect2::Helpers end