Sha256: 04e0af4cd718a9d4d0b7152fbbd62a4d2fb46bdaa8bf4482419a7859f043fcf2

Contents?: true

Size: 715 Bytes

Versions: 3

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

# Allow to override the initial windows size
CAPYBARA_WINDOW_SIZE = (ENV['CAPYBARA_WINDOW_SIZE'] || '1920x1080').split('x', 2).map(&:to_i)

Capybara.javascript_driver = (ENV['CAPYBARA_JAVASCRIPT_DRIVER'] || "solidus_chrome_headless").to_sym
Capybara.default_max_wait_time = 10
Capybara.server = :puma, { Silent: true } # A fix for rspec/rspec-rails#1897

Capybara.drivers[:selenium_chrome_headless].tap do |original_driver|
  Capybara.register_driver :solidus_chrome_headless do |app|
    original_driver.call(app).tap do |driver|
      driver.options[:options].args << "--window-size=#{CAPYBARA_WINDOW_SIZE.join(',')}"
    end
  end
end

require 'spree/testing_support/capybara_ext'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_dev_support-2.1.0 lib/solidus_dev_support/rspec/capybara.rb
solidus_dev_support-2.0.1 lib/solidus_dev_support/rspec/capybara.rb
solidus_dev_support-2.0.0 lib/solidus_dev_support/rspec/capybara.rb