[rb] Update unhandled_prompt_behavior capability to support hash syntax.#16289
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
6d33076 to
a6558cc
Compare
unhandled_prompt_behavior capability to support hash syntax.unhandled_prompt_behavior capability to support hash syntax.
p0deje
left a comment
There was a problem hiding this comment.
The changes look great. Can you please just fix a formatting issue (probably a trailing space), and then it's good to merge.
|
Thank you for your contribution! |
User description
💥 What does this PR do?
This PR extends the capability processing method to correctly support the struct format of UserPromptHandler for unhandledPromptBehaviour in a CapabilityRequest
The current implementation supports the "string" only values format. For correct BiDi operation the more complex hash format is required due to a recent change in the Chrome BiDi driver code to enforce
beforeUnloadto beacceptwhen only strings are used.The code that worked before the Chrome BiDi update:
The code that now does the same after the Chrome BiDi update:
🔧 Implementation Notes
The implement is backwards compatible with existing code .
💡 Additional Considerations
This PR is to resolve an issue I originally raised in the Capybara project teamcapybara/capybara#2824
This PR does not update the web documentation for Selenium
🔄 Types of changes
PR Type
Enhancement
Description
Add support for hash format in
unhandled_prompt_behaviorcapabilityMaintain backward compatibility with existing string format
Enable proper BiDi operation with Chrome driver updates
Add comprehensive test coverage for hash value processing
Diagram Walkthrough
File Walkthrough
options.rb
Enhanced capability processing for hash formatrb/lib/selenium/webdriver/common/options.rb
unhandled_prompt_behaviorprocessing into dedicated methodoptions_spec.rb
Test coverage for hash format capabilityrb/spec/unit/selenium/webdriver/chrome/options_spec.rb
unhandled_prompt_behavior