-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[py][bidi]: implement bidi module - emulation #15819
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
base: trunk
Are you sure you want to change the base?
Conversation
The tests require |
b8d7862
to
18eeca9
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
🔗 Related Issues
💥 What does this PR do?
Adds support for the emulation module in python bindings - https://w3c.github.io/webdriver-bidi/#module-emulation
🔧 Implementation Notes
Usage:
From
contexts
:From
user_contexts
:Important
Either
user_contexts
orcontexts
should be passed, both cannot coexist.💡 Additional Considerations
The tests need the BiDi permissions module to grant the geolocation permission in order to fetch them.
Note
Currently, when the
Error
parameter is passed, it is returning an errorinvalid argument: Invalid input in "coordinates
, hence the test is commented out for now.It is fixed in chrome canary.
🔄 Types of changes
PR Type
Enhancement
Description
• Implement BiDi emulation module for Python bindings
• Add geolocation override functionality with coordinates support
• Include comprehensive test coverage for contexts and user contexts
• Support multiple browsing contexts and user contexts
Changes walkthrough 📝
emulation.py
New BiDi emulation module implementation
py/selenium/webdriver/common/bidi/emulation.py
• Create new emulation module with GeolocationCoordinates and
GeolocationPositionError classes
• Implement set_geolocation_override
method supporting contexts and user_contexts
• Add comprehensive
validation for coordinate ranges and parameter combinations
• Include
proper error handling and type annotations
webdriver.py
WebDriver emulation property integration
py/selenium/webdriver/remote/webdriver.py
• Add emulation property to WebDriver class
• Import Emulation module
and initialize _emulation attribute
• Provide lazy initialization with
BiDi connection setup
bidi_emulation_tests.py
Comprehensive emulation module test suite
py/test/selenium/webdriver/common/bidi_emulation_tests.py
• Add comprehensive test suite for emulation module functionality
•
Test geolocation override with coordinates in contexts and user
contexts
• Include tests for multiple contexts and all coordinate
parameters
• Add helper function for browser geolocation testing