-
-
Couldn't load subscription status.
- Fork 8.6k
[py][bidi]: add emulation command - set_locale_override
#16504
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
…mulation-locale-py
…mulation-locale-py
validation is done on the remote end, and error on incorrect locale will propagate as WebdriverException
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
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.
The 2nd AI suggestion (test cleanup) might be worth doing.
Nice use of parametrize in the tests!
|
Leaving a note here for future reference: The BiDi emulation command So, when its merged and released, one should be able to override Related work and PR: |
User description
🔗 Related Issues
💥 What does this PR do?
Adds support for
set_locale_overridecommands from the Emulation module - https://w3c.github.io/webdriver-bidi/#command-emulation-setLocaleOverride🔧 Implementation Notes
Usage:
💡 Additional Considerations
Initially, I thought of adding validation of locale but it added a new dep -
langcodeswhich is not good. Since validation is done on the remote end, it is not required and any error coming from validation from remote end will be propagated by selenium asWebdriverExceptionto the user's terminal.🔄 Types of changes
PR Type
Enhancement
Description
Add
set_locale_overridecommand to emulation moduleSupport both browsing contexts and user contexts
Include comprehensive parametrized tests for various locales
Validate mutually exclusive context parameters
Diagram Walkthrough
File Walkthrough
emulation.py
Implement set_locale_override emulation commandpy/selenium/webdriver/common/bidi/emulation.py
set_locale_overridemethod to the Emulation classlocaleparameter (BCP 47 format or None to clear)contextsanduser_contextsparametersemulation.setLocaleOverridecommand via BiDibidi_emulation_tests.py
Add comprehensive tests for locale override functionalitypy/test/selenium/webdriver/common/bidi_emulation_tests.py
get_browser_localeto retrieve current browserlocale
locale variants)
variants)