-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[py] do not use global var for devtools, allows multiple devtools to run #15881
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
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 work. Thanks for fixing this.
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.
@Delta456 The tests fail because the clean_driver
fixture does not follows the xfail
rules as the driver
fixture does and launches test against firefox even if we mention xfail.
You will need to modify the clean_driver
fixture in conftest.py
to include the xfail
logic similar to this:
Lines 327 to 337 in cc3ea7b
# conditionally mark tests as expected to fail based on driver | |
marker = request.node.get_closest_marker(f"xfail_{driver_class.lower()}") | |
if marker is not None: | |
if "run" in marker.kwargs: | |
if marker.kwargs["run"] is False: | |
pytest.skip() | |
yield | |
return | |
if "raises" in marker.kwargs: | |
marker.kwargs.pop("raises") | |
pytest.xfail(**marker.kwargs) |
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.
LGTM!
@Delta456 looks good to merge. Let me know if you don't have access and I'll merge it. |
I now have access. I will merge it in few hours :) |
User description
🔗 Related Issues
💥 What does this PR do?
Fixes #15816
🔧 Implementation Notes
Removes
global devtools
entirely and usedevtool
member inWebDriver
for whatever use💡 Additional Considerations
🔄 Types of changes
PR Type
Bug fix, Tests
Description
Refactored devtools from global to WebDriver instance member
Fixed bug allowing multiple devtools sessions per driver
Added test for starting devtools on multiple drivers
Changes walkthrough 📝
webdriver.py
Refactor devtools to instance member and fix multi-driver support
py/selenium/webdriver/remote/webdriver.py
drivers
devtools_tests.py
Add test for multiple devtools sessions per driver
py/test/selenium/webdriver/common/devtools_tests.py