Skip to content

Commit

Permalink
Drop webdrivers, upgrade capybara and selenium-webdriver (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandbergja authored Nov 20, 2023
1 parent 1537a23 commit 9d69ce1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ group :test do
gem "selenium-webdriver"
gem "simplecov", require: false
gem "timecop"
gem "webdrivers"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
27 changes: 11 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
airbrussh (1.4.1)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
Expand Down Expand Up @@ -94,7 +94,7 @@ GEM
capistrano-bundler (~> 1.1)
capistrano-yarn (2.0.2)
capistrano (~> 3.0)
capybara (3.37.1)
capybara (3.39.2)
addressable
matrix
mini_mime (>= 0.1.3)
Expand Down Expand Up @@ -192,7 +192,7 @@ GEM
matrix (0.4.2)
method_source (0.9.2)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.4.5)
multi_json (1.13.1)
Expand All @@ -210,7 +210,7 @@ GEM
net-protocol
net-ssh (7.2.0)
nio4r (2.5.9)
nokogiri (1.15.4)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
omniauth (1.9.2)
Expand All @@ -235,10 +235,10 @@ GEM
pry-byebug (3.7.0)
byebug (~> 11.0)
pry (~> 0.10)
public_suffix (4.0.7)
public_suffix (5.0.4)
puma (5.6.7)
nio4r (~> 2.0)
racc (1.7.1)
racc (1.7.3)
rack (2.2.8)
rack-proxy (0.6.5)
rack
Expand Down Expand Up @@ -291,15 +291,15 @@ GEM
reform-rails (0.1.7)
activemodel (>= 3.2)
reform (>= 2.2.0)
regexp_parser (2.6.1)
regexp_parser (2.8.2)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.5)
rexml (3.2.6)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
Expand Down Expand Up @@ -351,7 +351,7 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (4.7.0)
selenium-webdriver (4.15.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
Expand Down Expand Up @@ -400,11 +400,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.2.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
websocket (1.2.9)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down Expand Up @@ -464,7 +460,6 @@ DEPENDENCIES
uglifier (>= 1.3.0)
vite_rails (~> 3.0)
web-console (>= 3.3.0)
webdrivers
whenever

RUBY VERSION
Expand Down
14 changes: 6 additions & 8 deletions spec/support/capybara_selenium.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@

Capybara.server = :puma, { Silent: true }

Capybara.register_driver(:chrome_headless) do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
'goog:chromeOptions': { args: %w[headless disable-gpu disable-setuid-sandbox window-size=7680,4320] }
)
Capybara.register_driver(:selenium) do |app|

browser_options = ::Selenium::WebDriver::Chrome::Options.new
# browser_options.args << "--headless"
browser_options.args << "--headless"
browser_options.args << "--disable-gpu"
browser_options.args << "--disable-setuid-sandbox"
browser_options.args << "--window-size=7680,4320"

http_client = Selenium::WebDriver::Remote::Http::Default.new
http_client.read_timeout = 120
http_client.open_timeout = 120

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

Capybara.javascript_driver = :chrome_headless
Capybara.javascript_driver = :selenium

0 comments on commit 9d69ce1

Please sign in to comment.