Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Browser#preload for older Selenium #36602

Merged
merged 2 commits into from
Jul 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gemspec
gem "rake", ">= 11.1"

gem "capybara", ">= 2.15"
gem "selenium-webdriver", ">= 3.5.0"
gem "selenium-webdriver", ">= 3.141.592"

gem "rack-cache", "~> 1.2"
gem "sass-rails"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ DEPENDENCIES
rubocop-rails
sass-rails
sdoc (~> 1.0)
selenium-webdriver (>= 3.5.0)
selenium-webdriver (>= 3.141.592)
sequel
sidekiq
sneakers
Expand Down
14 changes: 12 additions & 2 deletions actionpack/lib/action_dispatch/system_testing/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,19 @@ def capabilities
def preload
case type
when :chrome
::Selenium::WebDriver::Chrome::Service.driver_path.try(:call)
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
::Selenium::WebDriver::Chrome::Service.driver_path.try(:call)
else
# Selenium <= v3.141.0
::Selenium::WebDriver::Chrome.driver_path
end
when :firefox
::Selenium::WebDriver::Firefox::Service.driver_path.try(:call)
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
::Selenium::WebDriver::Firefox::Service.driver_path.try(:call)
else
# Selenium <= v3.141.0
::Selenium::WebDriver::Firefox.driver_path
end
end
end

Expand Down