[docs] decision: browser user prompts are handled through a typed handler API#17672
Open
AutomatedTester wants to merge 1 commit into
Open
[docs] decision: browser user prompts are handled through a typed handler API#17672AutomatedTester wants to merge 1 commit into
AutomatedTester wants to merge 1 commit into
Conversation
ad2fdf9 to
c096920
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💥 What does this PR do?
Proposes a design decision record: browser user prompts are handled through a typed handler API.
JavaScript dialogs (
alert/confirm/prompt/beforeunload) block the page until handled. WebDriver Classic only exposes them reactively viaswitch_to.alert, which races the dialog opening and can't pre-decide behaviour. BiDi models them properly (userPromptOpened/handleUserPrompt/userPromptClosed+ theunhandledPromptBehaviorcapability). This record proposes a consistent handler API across bindings: a persistent and a one-shot handler that receive a typedUserPrompt(.type/.message/.default_value/.accept(text)/.dismiss()), with dismiss-by-default when no handler is registered so a stray dialog never hangs the session. The static capability route stays for fixed session policies;expect_user_promptstays for the assert-it-appeared case.🔧 Implementation Notes
docs/decisions/process from [docs] add design decision record process and template #17665 — depends on [docs] add design decision record process and template #17665 landing (adds onlydocs/decisions/0002-*.md).expect_*primitive proposed in [docs] decision: BiDi events are awaited with expect_* context managers #17671 (record 0001).🤖 AI assistance
💡 Additional Considerations
One of a set of BiDi ergonomics decision records proposed together. Cross-binding convergence is tracked in the record's binding-status table.
🔄 Types of changes