[py][bidi]: add unhandled_prompt_behavior param for create_user_context#16112
Conversation
…nhandled_prompt_behavior-param-browser
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
cgoldberg
left a comment
There was a problem hiding this comment.
You can use the native dict instead of importing Dict from typing.
I also like the "Simplify dictionary building logic" suggestion from the review bot, but that's up to you.
other than that, LGTM
User description
🔗 Related Issues
💥 What does this PR do?
Adds support for the optional
unhandled_prompt_behaviorparameter for browser module'screate_user_contextcommand - https://w3c.github.io/webdriver-bidi/#command-browser-createUserContext🔧 Implementation Notes
The required
UserPromptHandlerandUserPromptHandlerTypetypes are added tosession.pysince in the BiDi spec they come under the Session module types.Most of the WPT tests are failing for this parameter so currently I am verifying if the command supports the parameter in browsers (which it does). We also set
unhandled_prompt_behaviortoIGNOREinconftest.pywhich may affect the tests.💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add
unhandled_prompt_behaviorparameter tocreate_user_contextmethodImplement
UserPromptHandlerandUserPromptHandlerTypeclassesAdd test for new prompt behavior functionality
Diagram Walkthrough
File Walkthrough
browser.py
Add prompt behavior parameter to context creationpy/selenium/webdriver/common/bidi/browser.py
unhandled_prompt_behaviorparameter tocreate_user_contextmethodUserPromptHandlerfrom session modulesession.py
Implement user prompt handler classespy/selenium/webdriver/common/bidi/session.py
UserPromptHandlerTypeclass with valid prompt handler constantsUserPromptHandlerclass with validation and serializationbidi_browser_tests.py
Add test for prompt behavior configurationpy/test/selenium/webdriver/common/bidi_browser_tests.py
create_user_contextwithunhandled_prompt_behavior