From 1d4b146eb026cdd1054e22a6ee72deef26069083 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Mon, 29 Jan 2024 10:58:48 +0000 Subject: [PATCH] DRY up code --- features/support/env.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/features/support/env.rb b/features/support/env.rb index 4ec2bb6..7beea05 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -19,16 +19,15 @@ SimpleCov.start if defined?(SimpleCov) && RUBY_VERSION < '3.1' browser = ENV.fetch('BROWSER', 'chrome').to_sym -options = - if browser == :chrome - AutomationHelpers::Drivers::V4::Options.for(:chrome).tap do |opts| - opts.add_argument('--no-sandbox') - opts.add_argument('--disable-dev-shm-usage') - opts.add_argument('--disable-gpu') - end - else - AutomationHelpers::Drivers::V4::Options.for(:firefox) +options = AutomationHelpers::Drivers::V4::Options.for(browser) + +if browser == :chrome + options.tap do |opts| + opts.add_argument('--no-sandbox') + opts.add_argument('--disable-dev-shm-usage') + opts.add_argument('--disable-gpu') end +end Capybara.register_driver :site_prism do |app| Capybara::Selenium::Driver.new(