File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1616# Add additional requires below this line. Rails is not loaded until this point!
1717require_relative "./support/factory_bot"
1818
19+ require "capybara/rails"
20+
21+ GovukTest . configure
22+
23+ Capybara . register_driver :headless_chrome do |app |
24+ chrome_options = GovukTest . headless_chrome_selenium_options
25+ chrome_options . add_argument ( "--disable-web-security" )
26+ chrome_options . add_argument ( "--window-size=1400,1400" )
27+ chrome_options . add_argument ( "--no-sandbox" )
28+
29+ Capybara ::Selenium ::Driver . new (
30+ app ,
31+ browser : :chrome ,
32+ options : chrome_options ,
33+ )
34+ end
35+
1936# Requires supporting ruby files with custom matchers and macros, etc, in
2037# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
2138# run as spec files by default. This means that files in spec/support that end
4158 abort e . to_s . strip
4259end
4360RSpec . configure do |config |
61+ config . before ( :each , type : :system ) do
62+ driven_by :headless_chrome
63+ end
64+
4465 # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
4566 config . fixture_paths = [
4667 Rails . root . join ( "spec/fixtures" ) ,
You can’t perform that action at this time.
0 commit comments