-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] Fix driver class name in test fixtures #15550
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
[py] Fix driver class name in test fixtures #15550
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
I don't know what this AI is smoking, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
User description
Motivation and Context
This PR fixes some issues in the Python test configuration (PyTest fixtures).
Before this fix, running tests that use the
clean_driverorclean_servicefixture would fail when using certain--driveroptions.If
--driveroption was not included, the tests would fail with:TypeError: 'NoneType' object is not subscriptableNow they correctly fail with:
Exception: This test requires a --driver to be specifiedIf
--driver=webkitgtkor--driver=wpewebkitwas used, tests would fail with:AttributeError: module 'selenium.webdriver' has no attribute 'Webkitgtk'. Did you mean: 'webkitgtk'?or
AttributeError: module 'selenium.webdriver' has no attribute 'Wpewebkit'. Did you mean: 'wpewebkit'?Now the tests can be executed using these options.
This PR also fixes an issue where WebKitGTK and WPEWebKit tests were not skipped on non-Linux platforms.
Types of changes
Checklist
PR Type
Bug fix
Description
Fixed incorrect driver class name generation in test fixtures.
Added
get_driver_classfunction for consistent driver class handling.Improved error handling for missing or invalid
--driveroptions.Enhanced compatibility with
webkitgtkandwpewebkitdrivers.Changes walkthrough 📝
conftest.py
Refactored driver class handling and improved error messagespy/conftest.py
get_driver_classfunction to generate driver class names.clean_serviceandclean_driverfixtures to useget_driver_class.--driveroptions.webkitgtkandwpewebkitdriver options.