|
7 | 7 | require 'rspec/rails' |
8 | 8 | # Add additional requires below this line. Rails is not loaded until this point! |
9 | 9 | require 'action_cable/testing/rspec' |
| 10 | +require 'selenium/webdriver' |
10 | 11 |
|
11 | 12 | # Setup ActiveAdmin |
12 | 13 | ActiveAdmin.application.load_paths = [File.expand_path('dummy/app/admin', __dir__)] |
|
29 | 30 | # |
30 | 31 | # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f } |
31 | 32 |
|
| 33 | +Capybara.register_driver :chrome do |app| |
| 34 | + Capybara::Selenium::Driver.new(app, browser: :chrome) |
| 35 | +end |
| 36 | + |
| 37 | +Capybara.register_driver :headless_chrome do |app| |
| 38 | + capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( |
| 39 | + chromeOptions: { args: %w[headless no-sandbox disable-gpu] } |
| 40 | + ) |
| 41 | + |
| 42 | + Capybara::Selenium::Driver.new app, |
| 43 | + browser: :chrome, |
| 44 | + desired_capabilities: capabilities |
| 45 | +end |
| 46 | + |
| 47 | +Capybara.javascript_driver = :headless_chrome |
| 48 | + |
32 | 49 | # Checks for pending migrations and applies them before tests are run. |
33 | 50 | # If you are not using ActiveRecord, you can remove these lines. |
34 | 51 | begin |
|
0 commit comments