Repository navigation
Wait for the router's heading focus and the page's own scroll in the browser harness - #196
Open
pournasserian wants to merge 3 commits into
Open
pournasserian wants to merge 3 commits into
pournasserian wants to merge 3 commits into
Conversation
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.
Closes #193
Two causes in the harness, one fix each. No timeout raised, no retry, no check loosened.
Skeleton row: a pixel read off the screen
Reproduced. The row never failed alone (240 runs, also at 1.5 CPUs). Under the full Firefox suite at 4 CPUs (
fl-linuxcontainer) it failed in 8 of 11 runs of a whole mode (static, server and wasm).Cause. A scroll log in
ReadPixelAsyncshowed the sequence:TypeAsync("spring")the page is atscrollTop1354, with the search field in view.ScrollIntoViewIfNeededAsyncscrolls to 3413 to show the reset button.That caret scroll is queued when the text is typed. Under load it runs after the read's scroll, not before. The rest check then sees nothing move, and the button's box is 1774 px down in an 800 px window. The values were the same in every failure.
Fix.
ReadPixelAsyncwaits for the page to rest before it scrolls the indicator into view, so a scroll the page still owes runs first. It then asserts that the point is in the window, so a box off the screen fails with its position, not with Playwright's clip error.Focus rows: keys before the router's heading focus
Cause.
FocusOnNavigatefocuses theh1through a call that comes after the render that setsdata-interactive="true". A test that starts on the keys in that gap has its focus taken.StartAtTopAsync.:focusmatches, and the test did not wait for it.Fix.
GalleryFixture.WaitUntilReadyAsync(used byOpenAsync) also waits, in an interactive mode, until the page'sh1, if it has one, is the active element. This is the selector the router uses. It covers every test that uses the keys after opening a page, not only these two. The explicitFormsPage.FocusSettledAsynccalls are kept: some follow an in-app navigation, and the ones right after an open now return at once.Proof. The new
HarnessGuardTests.ReadyWaitsForTheRouterToFocusTheHeadingholds the router's focus back by one second. It fails in server and wasm without the fix (2/2) and passes with it.Field row (wasm): not reproduced
This row already waited for the heading before it used the keys. A probe recorded every
focus()call and focus event in Firefox wasm: the router focuses the heading once (5 of 5 runs), so a late second focus does not explain it. It did not fail in 2 full wasm runs or in 20 single-row runs in wasm. It was seen once in CI (46546226030). The CI log shows two elements matching:focusat once, the heading and the field reached. I could not explain that from the page, and this PR doesn't claim to fix it. The new wait does not change this row.Results
dotnet build -warnaserrorCONTRIBUTING.md)KeyboardSamples,EmptyStateTests,FieldTestsand the 12 classes that useTabToAndAssertPaintChangeAsyncUnrelated: under the same load,
ComboboxTests.RapidTextsShowOnlyTheAnswerToTheLatestOneandCommandPaletteTests.APointerRunsAResult…(server) failed once each, without this PR's changes. They are not among this issue's rows.