Skip to content

Commit

Permalink
Consider selenium-webdriver version for Ruby 2.7
Browse files Browse the repository at this point in the history
This commit addresses the Rails CI failure at 7-1-stable branch using Ruby 2.7
https://buildkite.com/rails/rails/builds/108575#019038c9-7c19-44e9-8c90-b257a3293450/1092-1106

Because selenium-webdriver >= 4.9.1 requires Ruby 3.0 then Gemfile of 7-1-stable branch
chooses the selenium-webdriver version based on the Ruby version.
rails#48847

Follow up rails@41844df
  • Loading branch information
yahonda committed Jun 21, 2024
1 parent 41844df commit 213538e
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions actionpack/test/dispatch/system_testing/driver_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,23 @@ class DriverTest < ActiveSupport::TestCase
end
driver.use

expected = {
"moz:firefoxOptions" => {
"args" => ["--host=127.0.0.1"],
"prefs" => { "remote.active-protocols" => 3, "browser.startup.homepage" => "http://www.seleniumhq.com/" }
},
"browserName" => "firefox"
}
if RUBY_VERSION < "3"
expected = {
"moz:firefoxOptions" => {
"args" => ["--host=127.0.0.1"],
"prefs" => { "browser.startup.homepage" => "http://www.seleniumhq.com/" }
},
"browserName" => "firefox"
}
else
expected = {
"moz:firefoxOptions" => {
"args" => ["--host=127.0.0.1"],
"prefs" => { "remote.active-protocols" => 3, "browser.startup.homepage" => "http://www.seleniumhq.com/" }
},
"browserName" => "firefox"
}
end
assert_driver_capabilities driver, expected
end

Expand All @@ -130,13 +140,23 @@ class DriverTest < ActiveSupport::TestCase
end
driver.use

expected = {
"moz:firefoxOptions" => {
"args" => ["-headless", "--host=127.0.0.1"],
"prefs" => { "remote.active-protocols" => 3, "browser.startup.homepage" => "http://www.seleniumhq.com/" }
},
"browserName" => "firefox"
}
if RUBY_VERSION < "3"
expected = {
"moz:firefoxOptions" => {
"args" => ["-headless", "--host=127.0.0.1"],
"prefs" => { "browser.startup.homepage" => "http://www.seleniumhq.com/" }
},
"browserName" => "firefox"
}
else
expected = {
"moz:firefoxOptions" => {
"args" => ["-headless", "--host=127.0.0.1"],
"prefs" => { "remote.active-protocols" => 3, "browser.startup.homepage" => "http://www.seleniumhq.com/" }
},
"browserName" => "firefox"
}
end
assert_driver_capabilities driver, expected
end

Expand Down

0 comments on commit 213538e

Please sign in to comment.