-
-
Couldn't load subscription status.
- Fork 8.6k
[py][bidi]: add emulation command set_scripting_enabled
#16513
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 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.
tiny nitpick: we are trying to standardize docstrings to use Google format: https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings
... so use Args: instead of Paramaters: and remove the ------.
|
I have formatted the emulation module to use google format, I see we have an open PR that addresses this for other modules. |
User description
🔗 Related Issues
💥 What does this PR do?
Adds support for the Emulation module command
set_scripting_enabled- https://w3c.github.io/webdriver-bidi/#command-emulation-setScriptingEnabled🔧 Implementation Notes
💡 Additional Considerations
Not yet supported in Firefox, so marked as
xfail.🔄 Types of changes
PR Type
Enhancement
Description
Adds
set_scripting_enabledemulation command to disable JavaScriptSupports both browsing contexts and user contexts
Includes comprehensive validation and error handling
Adds two test cases with Firefox xfail markers
Diagram Walkthrough
File Walkthrough
emulation.py
Add set_scripting_enabled emulation commandpy/selenium/webdriver/common/bidi/emulation.py
set_scripting_enabled()method to the Emulation classsupported
both
emulation.setScriptingEnabledBiDi command withappropriate parameters
bidi_emulation_tests.py
Add tests for set_scripting_enabled functionalitypy/test/selenium/webdriver/common/bidi_emulation_tests.py
test_set_scripting_enabled_with_contexts()to verify JavaScriptdisabling with browsing contexts
test_set_scripting_enabled_with_user_contexts()to verifyJavaScript disabling with user contexts
normally after clearing override
@pytest.mark.xfail_firefoxdue to Firefox notyet supporting this feature