File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 6262 # config.action_view.annotate_rendered_view_with_filenames = true
6363
6464 config . i18n . enforce_available_locales = false
65+
66+ # Add config/routes_test.rb to routes
67+ config . paths [ 'config/routes.rb' ] << Rails . root . join ( 'config/routes_test.rb' )
6568end
6669
6770# Used by Rails' routes url_helpers (typically when including a link in an email)
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ Rails . application . routes . draw do
4+ # Define your test-specific routes here
5+
6+ # This route will return an empty response with a 200 OK status code
7+ # when the browser requests the favicon.ico file.
8+ get '/favicon.ico' , to : proc { |_env | [ 200 , { } , [ '' ] ] }
9+ end
Original file line number Diff line number Diff line change 66# Use the fast rack_test driver for non-feature tests by default
77Capybara . default_driver = :rack_test
88
9+ # Create a custom driver based on Capybara's :selenium_chrome_headless driver
10+ # This resolves a ElementClickInterceptedError when executing `click_button 'Sign in'` with DMP Assistant
11+ Capybara . register_driver :selenium_chrome_headless_add_window_size do |app |
12+ # Get a copy of the default options for Capybara's :selenium_chrome_headless driver
13+ options = Capybara . drivers [ :selenium_chrome_headless ] . call . options [ :options ] . dup
14+ options . add_argument ( '--window-size=1920,1080' ) # default window-size is only (800x600)
15+ # Create a new Selenium driver with the customised options
16+ Capybara ::Selenium ::Driver . new ( app , browser : :chrome , options : options )
17+ end
18+
919RSpec . configure do |config |
1020 config . before ( :each , type : :feature , js : false ) do
1121 Capybara . use_default_driver
1222 end
1323
1424 # Use the Selenium headless Chrome driver for feature tests
1525 config . before ( :each , type : :feature , js : true ) do
16- Capybara . current_driver = :selenium_chrome_headless
26+ Capybara . current_driver = :selenium_chrome_headless_add_window_size
1727 end
1828end
You can’t perform that action at this time.
0 commit comments