Skip to content

Commit

Permalink
DRY up code
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-hill committed Jan 29, 2024
1 parent 128a773 commit 1d4b146
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1d4b146

Please sign in to comment.