fix(functional-tests): fix failing stage tests#20539
Merged
Conversation
Because: - The "Continue dispatches pair_preferences" smoke test was racing Firefox's chrome handler, which navigates the tab to about:preferences synchronously when it sees the WebChannel dispatch and tore the page down before page.evaluate's reply could reach Playwright. The has-mobile and needs-mobile choices share the same submit handler; the latter has an in-page view transition we can observe directly, and the unit tests in fxa-settings already cover the WebChannel dispatch with mocks. This commit: - Updates pairChoice.spec.ts to select needs-mobile, click Continue, and assert the download view's heading appears.
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the Pair entry flow smoke test in packages/functional-tests to avoid a reliable Playwright failure caused by Firefox tearing down the tab after a WebChannel dispatch, by asserting an in-page view transition instead of observing the WebChannel event.
Changes:
- Updates the “Continue” smoke test to select the
needs-mobilepath and assert the download view (#pair-header-mobile) becomes visible. - Removes the page-side event listener/promise that attempted to capture
WebChannelMessageToChromedispatches. - Renames the test to reflect the new behavior under test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }); | ||
|
|
||
| test('Continue on the choice screen dispatches pair_preferences', async ({ | ||
| test('Continue advances to the download view when no mobile is selected', async ({ |
dschom
approved these changes
May 7, 2026
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.
Because
Target page, context or browser has been closed.about:preferences#syncwhen it sees theWebChannelMessageToChromedispatch, tearing the page down before anypage.evaluatereply (or console round-trip) can reach Playwright. There is no observable side effect in the page for thehas-mobilepath that survives the teardown.packages/fxa-settings/src/pages/Pair/Index/index.test.tsxwith the WebChannel mocked. The functional test added flake without unique coverage.This pull request
pairChoice.spec.tsso the Continue-button smoke test selectsneeds-mobile, clicks Continue, and asserts the in-page download view (#pair-header-mobile) appears. SamehandleChoiceSubmithandler, no race against tab teardown.Issue that this pull request solves
Checklist
Other information
How to test:
cd packages/functional-tests
CI_WAF_TOKEN= yarn test-stage --grep "Pair entry flow" --reporter=list