Skip to content

Commit

Permalink
Merge pull request #36602 from jhawthorn/system_testing_preload_2
Browse files Browse the repository at this point in the history
Fix Browser#preload for older Selenium
  • Loading branch information
jhawthorn committed Jul 6, 2019
2 parents a05a9b0 + 5dbc814 commit bf7ce13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
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
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
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

0 comments on commit bf7ce13

Please sign in to comment.