Skip to content

Instantly share code, notes, and snippets.

@somenugget
Created February 27, 2021 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somenugget/bcd75a56e637474de2b9ee4adabe33bf to your computer and use it in GitHub Desktop.
Save somenugget/bcd75a56e637474de2b9ee4adabe33bf to your computer and use it in GitHub Desktop.
cuprite_setup.rb
require 'capybara/cuprite'
# Then, we need to register our driver to be able to use it later
# with #driven_by method.
Capybara.register_driver(:cuprite) do |app|
Capybara::Cuprite::Driver.new(
app,
**{
window_size: [1200, 800],
# See additional options for Dockerized environment in the respective section of this article
browser_options: {},
# Increase Chrome startup wait time (required for stable CI builds)
process_timeout: 30,
timeout: 30,
# Enable debugging capabilities
inspector: true,
# Allow running Chrome in a headful mode by setting HEAD env
# var to a truthy value
headless: !ENV['HEAD'].in?(%w[y 1 yes true]),
# Allow slow requests
pending_connection_errors: false
}
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment