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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix system tests with Chrome cached by Selenium #50296

Merged

Conversation

jonathanhefner
Copy link
Member

@jonathanhefner jonathanhefner commented Dec 7, 2023

Follow-up to #49908.

When Selenium resolves the driver path to a copy of Chrome that it has downloaded / cached, it mutates the Selenium::WebDriver::Chrome::Options object it receives, and relies on those changes later when the options are used. If Selenium::WebDriver::Chrome::Service.driver_path is set but a different options object is used, Selenium will raise "cannot find Chrome binary". Therefore, this commit ensures that the options object passed to Selenium::WebDriver::DriverFinder.path is the same options object used by the driver later.

Fixes #50287.

Follow-up to rails#49908.

When Selenium resolves the driver path to a copy of Chrome that it has
downloaded / cached, it mutates the `Selenium::WebDriver::Chrome::Options`
object it receives, and relies on those changes later when the options
are used.  If `Selenium::WebDriver::Chrome::Service.driver_path` is set
but a different options object is used, Selenium will raise "cannot find
Chrome binary".  Therefore, this commit ensures that the options object
passed to `Selenium::WebDriver::DriverFinder.path` is the same options
object used by the driver later.
@jonathanhefner jonathanhefner force-pushed the follow-up-49908-fix-cached-chrome branch from aae1852 to be272a8 Compare December 7, 2023 18:53
@jonathanhefner jonathanhefner merged commit 049c951 into rails:main Dec 7, 2023
4 checks passed
jonathanhefner added a commit that referenced this pull request Dec 21, 2023
…hed-chrome

Fix system tests with Chrome cached by Selenium

(cherry picked from commit 049c951)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rails 7.1.2 system tests won't find Chrome downloaded by selenium-webdriver
1 participant