[py][bidi]: add high level API for script module - pin, unpin and execute#15936
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
…y-bidi-script-high-level-API
…y-bidi-script-high-level-API
p0deje
left a comment
There was a problem hiding this comment.
Looks great! I think we might want to tweak execute so it can accept non-function scripts because at some point we'd like to replace driver.execute_script with driver.script.execute and the former one accepts plain scripts. Something like this:
driver.script.execute("return window.location;")This can be done later however, thank you for working on this!
|
Thank you @p0deje for the review, I will try to implement your suggestion in the future. |
User description
🔗 Related Issues
💥 What does this PR do?
Adds 3 high level SCRIPT APIs as mentioned in #13992
pinunpinexecute🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add high-level BiDi script API methods:
pin,unpin,executeImplement argument conversion for BiDi LocalValue format
Add comprehensive test coverage for script execution scenarios
Enable script pinning/unpinning and execution with error handling
Changes walkthrough 📝
script.py
Implement high-level BiDi script API methodspy/selenium/webdriver/common/bidi/script.py
pin(),unpin(),execute()webdriver.py
Update Script initialization with driver referencepy/selenium/webdriver/remote/webdriver.py
bidi_script_tests.py
Add comprehensive tests for high-level script APIpy/test/selenium/webdriver/common/bidi_script_tests.py