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] Use online mapping to discover proper geckodriver version (#11671) #13133

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

bonigarcia
Copy link
Member

Description

This PR implements a mechanism to discover the proper geckodriver based on online metadata.

Since the official Firefox-geckodriver mapping metadata are still unavailable (see feature request), we can maintain our mapping as proposed in #11671.

As a first step of this PR, I have uploaded this mapping (as a JSON file, as proposed here) to the trunk branch. This mapping is available at:

https://raw.githubusercontent.com/SeleniumHQ/selenium/trunk/common/geckodriver/geckodriver-support.json

This file is a JSON representation of the official supported versions by geckodriver:

https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html

I am subscribed to the new geckodriver releases, so I will manually update our geckodriver-support.json file when new geckodriver versions are released.

Some example of this feature:

./selenium-manager --browser firefox --debug --avoid-browser-download --browser-version 90
DEBUG   geckodriver not found in PATH
DEBUG   firefox detected at C:\Program Files\Mozilla Firefox\firefox.exe
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=119.0.0.8692\r\r\n\r\r\n\r\r\n\r"
DEBUG   Detected browser: firefox 119.0.0.8692
DEBUG   Discovered firefox version (119) different to specified browser version (90)
DEBUG   Valid geckodriver versions for firefox 90: ["0.30.0", "0.29.1", "0.29.0", "0.28.0", "0.27.0", "0.26.0", "0.25.0"]
DEBUG   Required driver: geckodriver 0.30.0
DEBUG   geckodriver 0.30.0 already in the cache
INFO    Driver path: C:\Users\boni\.cache\selenium\geckodriver\win64\0.30.0\geckodriver.exe
INFO    Browser path: C:\Program Files\Mozilla Firefox\firefox.exe

Motivation and Context

This issue implements #11671.

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.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (feece00) 57.47% compared to head (8cf0641) 57.47%.
Report is 2 commits behind head on trunk.

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

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #13133   +/-   ##
=======================================
  Coverage   57.47%   57.47%           
=======================================
  Files          86       86           
  Lines        5293     5293           
  Branches      221      221           
=======================================
  Hits         3042     3042           
  Misses       2030     2030           
  Partials      221      221           

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

@titusfortner titusfortner merged commit 69ea44a into trunk Nov 10, 2023
47 checks passed
@titusfortner titusfortner deleted the sm_geckodriver branch November 10, 2023 14:27
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.

3 participants