Repository navigation
test(shell-live): clicks wait for a still, hittable target (fixes the mascot-sheet flake that turned main red) - #789
Merged
Conversation
… pointer, fixing the mascot-sheet flake The merged sheet refills its notification list from a fetch every time it opens; when that lands after OPEN_SHEET, the bottom-anchored sheet's rows move and a click measured once lands on empty space (the "talk overlay" wait then times out). click()/hold() now wait for the centre to be stable across two frames and hit by elementFromPoint; the reopen also waits for the list, as the first open already did. Test-only. Claude-Session: https://claude.ai/code/session_01N9fXzvNy8rCEArj1y5p6fp
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.
Fixes the flaky
tests/shell-live.test.jstest "the mascot opens ONE sheet …", which turned main red and so stopped every instance's auto-update. It failed 2 of 3 recent suite runs, timing out at "the talk overlay, the sheet closed".Cause
The merged mascot sheet refills its notification list with a fetch every time it opens. The sheet is a bottom-anchored dialog, so when the fetch lands after
OPEN_SHEETis already true, its rows move. The test'sclick(sel)measured the target's centre once and clicked there, so under CI load it could hit empty space or a neighbouring element, and the Talk row never received the click.Fix (test-only)
click()andhold()now wait, for up to 3 s, until the target's centre is the same across two frames ANDdocument.elementFromPointat that point is the target or inside it. If that never happens, they throw an error naming the selector and the last two positions, so a future layout problem fails clearly instead of flaking.No product code changes.
Tests
tests/shell-live.test.jsran 3 times in the sandboxed runner with headless Chrome: 19 pass, 0 fail, 1 skip each time (the screenshots test, which only runs withSHELL_SHOTS_DIR). The public hygiene check passes.Implemented by the Pi coding agent from a controller brief and reviewed by the controller (test-only, 25 lines).
https://claude.ai/code/session_01N9fXzvNy8rCEArj1y5p6fp