makandra / geordi

Collection of command line tools used in our daily work with Ruby, Rails and Linux.
https://makandra.com/
MIT License
103 stars 17 forks source link

Update chromedriver update routine #200

Closed codener closed 1 year ago

codener commented 1 year ago

ChromedriverUpdater currently installs a chromedriver with the same version as Chrome. This strategy does not seem to hold any more, as chromedriver announces:

If you are using Chrome version 115 or newer, please consult the Chrome for Testing availability dashboard. This page provides convenient JSON endpoints for specific ChromeDriver version downloading.

Geordi will have to adopt the new way. However, we'll need to verify whether the new chromedriver-Chrome mapping will work with the normal Chrome, or require the Chrome for Testing.

Resources

codener commented 1 year ago

Workaround: Until Geordi is updated, you need to disable automatic updating of chromedriver in ~/.config/geordi/global.yml: auto_update_chromedriver: false.

Should your local chromedriver become too old for a newer Chrome, you can manually update chromedriver:

  1. Open https://googlechromelabs.github.io/chrome-for-testing/
  2. In Section "Stable" > chromedriver / linux64 > Download ZIP from URL
  3. Take chromedriver from the ZIP file and put it e.g. into ~/bin.
NiklasHae commented 1 year ago

Hey @codener, updating to selenium-webdriver (4.11.0) includes a feature that downloads drivers if they're missing, that's enabled by default (not sure if it's possible to disable, or if it would be a good idea to disable it).

It would probably make sense to think of a good upgrade path for the whole chromedriver issue, since it's unavoidable to update to newer selenium-webdriver version at some time in the future and both methods (geordi command, selenium-manager) should not conflict with each other. wdyt?

codener commented 1 year ago

Thanks for the notice, @NiklasHae. For the moment, Geordi will have to support projects that cannot upgrade their selenium-webdriver. However, any project that can update should do it.

As for conflicts: the chromedriver binary installed by selenium-webdriver might be shadowed by the chromedriver installed by Geordi. People who want to move away from Geordi maintaining chromedriver should disable the auto-updating (auto_update_chromedriver in ~/.config/geordi/global.yml) and remove the binary (which chromedriver).

To fix Geordi, we should update Geordi::ChromedriverUpdater with download URLs from https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json. Docs.