Install Cuprite for Capybara
mainAdd cuprite to your Gemfile within the :test group and run bundle install. To use it with Capybara, require capybara/cuprite, set the javascript_driver to :cuprite, and register the driver. If running in a Docker environment, you must pass the no-sandbox option via browser_options.
# Gemfile
group :test do
gem "cuprite"
endTest Setup
require "capybara/cuprite" Capybara.javascript_driver = :cuprite Capybara.register_driver(:cuprite) do |app| Capybara::Cuprite::Driver.new(app, window_size: [1200, 800]) end
Docker Setup
Capybara::Cuprite::Driver.new(app, browser_options: { 'no-sandbox': nil })