Capybara.configure do |config| config.match = :prefer_exact end Capybara.register_driver :selenium_chrome do |app| options = Selenium::WebDriver::Chrome::Options.new( args: %w[headless disable-gpu no-sandbox] ) Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) end Capybara.server = :webrick Capybara.javascript_driver = :selenium_chrome