-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[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_driver
orclean_service
fixture would fail when using certain--driver
options.If
--driver
option was not included, the tests would fail with:TypeError: 'NoneType' object is not subscriptable
Now they correctly fail with:
Exception: This test requires a --driver to be specified
If
--driver=webkitgtk
or--driver=wpewebkit
was 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_class
function for consistent driver class handling.Improved error handling for missing or invalid
--driver
options.Enhanced compatibility with
webkitgtk
andwpewebkit
drivers.Changes walkthrough 📝
conftest.py
Refactored driver class handling and improved error messages
py/conftest.py
get_driver_class
function to generate driver class names.clean_service
andclean_driver
fixtures to useget_driver_class
.--driver
options.webkitgtk
andwpewebkit
driver options.