[rb] Fix failing firefox beta tests for browser context#17199
[rb] Fix failing firefox beta tests for browser context#17199aguspe wants to merge 3 commits intoSeleniumHQ:trunkfrom
Conversation
Review Summary by QodoFix flaky Firefox Beta tests using BiDi event subscriptions
WalkthroughsDescription• Replace alert-based waiting with native BiDi event subscriptions • Group related user prompt tests into shared context • Use BiDi callbacks to detect prompt opening instead of alert helpers • Add driver reset with ignore unhandled prompt behavior File Changes1. rb/spec/integration/selenium/webdriver/bidi/browsing_context_spec.rb
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Pull request overview
Updates Ruby BiDi integration tests around user prompt handling to reduce flakiness seen on Firefox Beta by waiting on BiDi prompt events instead of relying on legacy alert helpers.
Changes:
- Refactors the user-prompt specs into a dedicated
contextthat resets the driver withunhandled_prompt_behavior: :ignore. - Switches prompt detection to BiDi event subscription (
browsingContext.userPromptOpened) before callinghandle_user_prompt. - Removes
wait_for_alert/wait_for_no_alertusage from these BiDi prompt tests.
You can also share your feedback on Copilot code review. Take the survey.
rb/spec/integration/selenium/webdriver/bidi/browsing_context_spec.rb
Outdated
Show resolved
Hide resolved
rb/spec/integration/selenium/webdriver/bidi/browsing_context_spec.rb
Outdated
Show resolved
Hide resolved
rb/spec/integration/selenium/webdriver/bidi/browsing_context_spec.rb
Outdated
Show resolved
Hide resolved
rb/spec/integration/selenium/webdriver/bidi/browsing_context_spec.rb
Outdated
Show resolved
Hide resolved
rb/spec/integration/selenium/webdriver/bidi/browsing_context_spec.rb
Outdated
Show resolved
Hide resolved
rb/spec/integration/selenium/webdriver/bidi/browsing_context_spec.rb
Outdated
Show resolved
Hide resolved
rb/spec/integration/selenium/webdriver/bidi/browsing_context_spec.rb
Outdated
Show resolved
Hide resolved
|
@aguspe I'm not totally sure, but I think the failures in Firefox Beta are related to: mozilla/geckodriver#2241 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
| it 'accepts user prompts without text' do | ||
| browsing_context = described_class.new(bridge) | ||
|
|
There was a problem hiding this comment.
These user-prompt examples previously had an except for Chrome/Edge (linked to chromium-bidi issue #3281). This PR removes that exclusion, so the specs will now run on Chrome/Edge (the outer only includes them) and may reintroduce known failures. If the upstream issue is still relevant, please restore the except metadata (or update it with the correct reason/issue if it’s been resolved).
@cgoldberg thank you so much for the link! I'm trying to give it a try to only use BiDi events and fix these tests to make it more resilient in the future too, and make it less flaky. Maybe it's not the best approach but if it works we will not have to wait until the 24th to try it out :) |
🔗 Related Issues
I made this pr #17188, and I keep getting Firefox Beta errors
💥 What does this PR do?
I'm trying to use event subscription that is natively BiDi for the test instead of alert and see if this fixes the errors
🔧 Implementation Notes
I think using the dismiss alert action was messing with the handle user prompt from bidi
🔄 Types of changes