Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ngan committed May 3, 2024
1 parent 453f1ca commit 817ddf9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions actionpack/test/dispatch/system_testing/driver_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,15 @@ class DriverTest < ActiveSupport::TestCase
# Our stub must return paths to a real executables, otherwise an internal Selenium assertion will fail.
# Note: SeleniumManager is private api
found_executable = RbConfig.ruby
::Selenium::WebDriver::SeleniumManager.stub(:binary_paths, { "driver_path" => found_executable, "browser_path" => found_executable }) do
ActionDispatch::SystemTesting::Driver.new(:selenium, screen_size: [1400, 1400], using: :chrome)

if ::Selenium::WebDriver::SeleniumManager.respond_to?(:binary_paths)
::Selenium::WebDriver::SeleniumManager.stub(:binary_paths, { "driver_path" => found_executable, "browser_path" => found_executable }) do
ActionDispatch::SystemTesting::Driver.new(:selenium, screen_size: [1400, 1400], using: :chrome)
end
else
::Selenium::WebDriver::SeleniumManager.stub(:driver_path, found_executable) do
ActionDispatch::SystemTesting::Driver.new(:selenium, screen_size: [1400, 1400], using: :chrome)
end
end

assert_equal found_executable, ::Selenium::WebDriver::Chrome::Service.driver_path
Expand Down

0 comments on commit 817ddf9

Please sign in to comment.