Skip to content

Commit

Permalink
fix capybara config
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Feb 22, 2024
1 parent b2c727e commit 67a0e03
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ end

group :test do
gem 'capybara'
gem 'selenium-webdriver'
gem 'selenium-webdriver', '~> 4.18', '>= 4.18.1'
gem 'simplecov'
gem 'webdrivers'
end
Expand Down
10 changes: 6 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ GEM
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
ast (2.4.2)
base64 (0.2.0)
bindata (2.4.15)
bleib (0.0.8)
bootsnap (1.18.3)
Expand Down Expand Up @@ -367,7 +368,8 @@ GEM
seed-fu (2.3.9)
activerecord (>= 3.1)
activesupport (>= 3.1)
selenium-webdriver (4.10.0)
selenium-webdriver (4.18.1)
base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
Expand Down Expand Up @@ -410,10 +412,10 @@ GEM
unicode-display_width (2.4.2)
unicode_utils (1.4.0)
uniform_notifier (1.16.0)
webdrivers (5.3.1)
webdrivers (5.2.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0, < 4.11)
selenium-webdriver (~> 4.0)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
Expand Down Expand Up @@ -471,7 +473,7 @@ DEPENDENCIES
rubocop
rubocop-rails
seed-fu
selenium-webdriver
selenium-webdriver (~> 4.18, >= 4.18.1)
sentry-raven
simplecov
spring
Expand Down
11 changes: 7 additions & 4 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
is_ci = ENV.fetch('IS_CI', false)

Capybara.register_driver :headless_chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new(
args: %w[headless no-sandbox disable-gpu disable-dev-shm-usage],
)
options = Selenium::WebDriver::Chrome::Options.new
options.add_option('--headless')
options.add_option('--no-sandbox')
options.add_option('--disable-gpu')
options.add_option('--disable-dev-shm-usage')


Capybara::Selenium::Driver.new(
app,
browser: :chrome,
options:
options: options
)
end

Expand Down

0 comments on commit 67a0e03

Please sign in to comment.