Created
February 27, 2021 20:21
-
-
Save somenugget/bcd75a56e637474de2b9ee4adabe33bf to your computer and use it in GitHub Desktop.
cuprite_setup.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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