aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-07-06 12:27:03 -0700
committerGitHub <noreply@github.com>2019-07-06 12:27:03 -0700
commitbf7ce13908636f619f9c7fe597e493bce2041c8e (patch)
tree78eaa59a61f57eabaeb3fbc0fd9c1dd70e9fcea3 /actionpack
parenta05a9b0e26d055131a4ed93f2b68abd4f792b376 (diff)
parent5dbc814ddfde99c4429532886aaec07c8d6ebb74 (diff)
downloadrails-bf7ce13908636f619f9c7fe597e493bce2041c8e.tar.gz
rails-bf7ce13908636f619f9c7fe597e493bce2041c8e.tar.bz2
rails-bf7ce13908636f619f9c7fe597e493bce2041c8e.zip
Merge pull request #36602 from jhawthorn/system_testing_preload_2
Fix Browser#preload for older Selenium
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/system_testing/browser.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/system_testing/browser.rb b/actionpack/lib/action_dispatch/system_testing/browser.rb
index f5f195d876..e861e52f09 100644
--- a/actionpack/lib/action_dispatch/system_testing/browser.rb
+++ b/actionpack/lib/action_dispatch/system_testing/browser.rb
@@ -46,9 +46,19 @@ module ActionDispatch
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