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

[rust] Include mirror arguments to change default online repository URLs (#11687) #12914

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

bonigarcia
Copy link
Member

Description

This PR includes a couple of new arguments in Selenium Manager for specifying custom URLs for drivers and browsers (instead of the default ones, such as https://chromedriver.storage.googleapis.com/, https://googlechromelabs.github.io/chrome-for-testing/, etc). These arguments are:

  • --driver-mirror-url: Mirror URL for driver repositories.
  • --browser-mirror-url: Mirror URL for browser repositories.

As usual, these values can be configured using the config file or envs (e.g., SE_DRIVER_MIRROR_URL or SE_BROWSER_MIRROR_URL).

Finally, there are browser and driver-specific configuration keys, such as SE_CHROMEDRIVER_MIRROR_URL, SE_GECKODRIVER_MIRROR_URL, SE_CHROME_MIRROR_URL, SE_FIREFOX_MIRROR_URL, etc.).

Here is an example of usage:

./selenium-manager --debug --browser chrome --browser-version 100 --avoid-browser-download --driver-mirror-url=https://registry.npmmirror.com/-/binary/chromedriver/

DEBUG   chromedriver not found in PATH
DEBUG   chrome detected at C:\Program Files\Google\Chrome\Application\chrome.exe
DEBUG   Running command: wmic datafile where name='C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' get Version /value
DEBUG   Output: "\r\r\n\r\r\nVersion=117.0.5938.150\r\r\n\r\r\n\r\r\n\r"
DEBUG   Detected browser: chrome 117.0.5938.150
DEBUG   Discovered chrome version (117) different to specified browser version (100)
DEBUG   Required driver: chromedriver 100.0.4896.60
DEBUG   Downloading chromedriver 100.0.4896.60 from https://registry.npmmirror.com/-/binary/chromedriver/100.0.4896.60/chromedriver_win32.zip
INFO    Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\100.0.4896.60\chromedriver.exe
INFO    Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe

Motivation and Context

This PR implements #11687.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bonigarcia
Copy link
Member Author

Yes, I don't know why the checksum in that file gets outdated, even if there is no changes in the Cargo.toml. I have just added a commit to update it.

@bonigarcia bonigarcia merged commit 966cb9f into trunk Oct 11, 2023
47 of 49 checks passed
@bonigarcia bonigarcia deleted the sm_mirror_url branch October 11, 2023 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants