Skip to content

Conversation

bonigarcia
Copy link
Member

Description

This PR allows the label stable to specify the current stable version recommended in the online metadata (currently, only CfT) of the different browser vendors. This label is used as the value of the flag --browser-version. Some examples:

Chrome stable (already installed in the system)

C:\Users\boni\Documents\dev\selenium\rust>cargo run -- --browser chrome --debug --browser-version stable
    Finished dev [unoptimized + debuginfo] target(s) in 0.26s
     Running `target\debug\selenium-manager.exe --browser chrome --debug --browser-version stable`
DEBUG   Checking chromedriver in PATH
DEBUG   Running command: chromedriver --version
DEBUG   Output: ""
DEBUG   chromedriver not found in PATH
DEBUG   chrome detected at C:\Program Files\Google\Chrome\Application\chrome.exe
DEBUG   Using shell command to find out chrome version
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=115.0.5790.99\r\r\n\r\r\n\r\r\n\r"
DEBUG   Detected browser: chrome 115.0.5790.99
DEBUG   Reading metadata from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json
DEBUG   Online stable chrome version (115) is the same as the one installed in the system
DEBUG   Reading metadata from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json
DEBUG   Required driver: chromedriver 115.0.5790.102
DEBUG   chromedriver 115.0.5790.102 already in the cache
INFO    Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\115.0.5790.102\chromedriver.exe
INFO    Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe

Chrome stable (forced to be downloaded)

C:\Users\boni\Documents\dev\selenium\rust>cargo run -- --browser chrome --debug --browser-version stable --force-browser-download
   Compiling selenium-manager v1.0.0-M4 (C:\Users\boni\Documents\dev\selenium\rust)
    Finished dev [unoptimized + debuginfo] target(s) in 2.87s
     Running `target\debug\selenium-manager.exe --browser chrome --debug --browser-version stable --force-browser-download`
DEBUG   Checking chromedriver in PATH
DEBUG   Running command: chromedriver --version
DEBUG   Output: ""
DEBUG   chromedriver not found in PATH
DEBUG   Reading metadata from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json
DEBUG   Required browser: chrome 115.0.5790.102
DEBUG   Downloading chrome 115.0.5790.102 from https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win64/chrome-win64.zip
DEBUG   chrome 115.0.5790.102 has been downloaded at C:\Users\boni\.cache\selenium\chrome\win64\115.0.5790.102\chrome.exe
DEBUG   Reading metadata from https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json
DEBUG   Required driver: chromedriver 115.0.5790.102
DEBUG   Driver URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win64/chromedriver-win64.zip
INFO    Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\115.0.5790.102\chromedriver.exe
INFO    Browser path: C:\Users\boni\.cache\selenium\chrome\win64\115.0.5790.102\chrome.exe

Edge stable

C:\Users\boni\Documents\dev\selenium\rust>cargo run -- --browser edge --debug --browser-version stable
    Finished dev [unoptimized + debuginfo] target(s) in 0.26s
     Running `target\debug\selenium-manager.exe --browser edge --debug --browser-version stable`
DEBUG   Checking msedgedriver in PATH
DEBUG   Running command: msedgedriver --version
DEBUG   Output: ""
DEBUG   msedgedriver not found in PATH
DEBUG   edge detected at C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
DEBUG   Using shell command to find out edge version
DEBUG   Running command: wmic datafile where name='C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe' get Version /value
DEBUG   Output: "\r\r\n\r\r\nVersion=115.0.1901.183\r\r\n\r\r\n\r\r\n\r"
DEBUG   Detected browser: edge 115.0.1901.183
DEBUG   Reading msedgedriver latest version from https://msedgedriver.azureedge.net/LATEST_STABLE
DEBUG   Latest msedgedriver major version is 115
DEBUG   Reading msedgedriver version from https://msedgedriver.azureedge.net/LATEST_RELEASE_115_WINDOWS
DEBUG   Required driver: msedgedriver 115.0.1901.183
DEBUG   Driver URL: https://msedgedriver.azureedge.net/115.0.1901.183/edgedriver_win64.zip
INFO    Driver path: C:\Users\boni\.cache\selenium\msedgedriver\win64\115.0.1901.183\msedgedriver.exe
INFO    Browser path: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe

Firefox stable

C:\Users\boni\Documents\dev\selenium\rust>cargo run -- --browser firefox --debug --browser-version stable
    Finished dev [unoptimized + debuginfo] target(s) in 0.28s
     Running `target\debug\selenium-manager.exe --browser firefox --debug --browser-version stable`
DEBUG   Checking geckodriver in PATH
DEBUG   Running command: geckodriver --version
DEBUG   Output: ""
DEBUG   geckodriver not found in PATH
DEBUG   firefox detected at C:\Program Files\Mozilla Firefox\firefox.exe
DEBUG   Using shell command to find out firefox version
DEBUG   Running command: wmic datafile where name='C:\\Program Files\\Mozilla Firefox\\firefox.exe' get Version /value
DEBUG   Output: "\r\r\n\r\r\nVersion=116.0.0.8585\r\r\n\r\r\n\r\r\n\r"
DEBUG   Detected browser: firefox 116.0.0.8585
DEBUG   Required driver: geckodriver 0.33.0
DEBUG   Driver URL: https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-win64.zip
INFO    Driver path: C:\Users\boni\.cache\selenium\geckodriver\win64\0.33.0\geckodriver.exe
INFO    Browser path: C:\Program Files\Mozilla Firefox\firefox.exe

Motivation and Context

This PR is a continuation of #12353 and #12410.

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.

@bonigarcia bonigarcia added the C-rust Rust code is mostly Selenium Manager label Jul 26, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (60a054b) 57.40% compared to head (cca97c2) 57.40%.

❗ Current head cca97c2 differs from pull request most recent head c5cbd7e. Consider uploading reports for the commit c5cbd7e to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #12422   +/-   ##
=======================================
  Coverage   57.40%   57.40%           
=======================================
  Files          86       86           
  Lines        5369     5369           
  Branches      206      206           
=======================================
  Hits         3082     3082           
  Misses       2081     2081           
  Partials      206      206           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@titusfortner titusfortner added this to the 4.11 milestone Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-rust Rust code is mostly Selenium Manager
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants