Skip to content

test(esports): scroll to an affordance before hovering it, not by pressing it - #972

Merged
ExtraToast merged 1 commit into
mainfrom
test/e2e-affordance-scroll
Sep 2, 2026
Merged

test(esports): scroll to an affordance before hovering it, not by pressing it#972
ExtraToast merged 1 commit into
mainfrom
test/e2e-affordance-scroll

Conversation

@ExtraToast

@ExtraToast ExtraToast commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #971, which hit this fault twice in the board specs. The esports specs have the
same shape and haven't flaked yet.

The problem

An edit pencil is visibility: hidden until the thing it belongs to is hovered. Playwright
scrolls an element into view as part of clicking it, and that scroll event is delivered
asynchronously — so the scroll moves the element out from under the pointer, the hover is lost,
the pencil disappears, and the click fails on an element it had already resolved:

- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
- element is not visible        ← repeatedly, until the 5s budget ran out

Whether the scroll happens at all depends on where the page is sitting, which is what makes it
intermittent. On #971 this cost two rounds of red CI, once as a hidden pencil and once as a tap
undone by its own scroll (stacked, a scroll releases a tap by design).

The change

Four helpers, one pattern: scroll, hover, assert the affordance is visible, then press.

  • esports-game-edit.spec.tsopenGameEditor, and the band's own per-game pencil
  • esports-game-remove.spec.tsopenGameEditor
  • esports-lineup-edit.spec.tsopenLineup

An element already in view has nothing to scroll, so on the paths that were passing this is a
no-op; it removes the dependence on luck.

Testing

48 pass across the three files in both projections (chromium and mobile-chrome). No production
code is touched.

The board-side equivalents landed with #971: boards.spec.ts (pressing a seat),
board-seat-edit.spec.ts (openSeat) and board-edit.spec.ts (openEditor). With this,
every helper in the suite that presses a hover-revealed affordance does it the same way.


Diff breakdown added removed, scaled to the largest row.

frontend                                           +44     -9    3
  e2e tests          ██████████████████████░░░░    +44     -9    3

──────────────────────────────────────────────────────────────────
production                                          +0     -0
tests                                              +44     -9
total (hand-written)                               +44     -9  3 files

… by pressing it

The board specs carried this fault and it cost two rounds of red CI on #971: a pencil is hidden
until what it belongs to is hovered, a click scrolls its target into view first, and that scroll
takes the element out from under the pointer, so the click loses the hover it needs and reports
the pencil as not visible. Whether the scroll is needed at all depends on where the page is
sitting, which is what made it come and go.

The esports specs have the same shape in four places and have not flaked, which is luck: their
bands are shorter and the target is usually already in view. Scrolling first, hovering second
and pressing third costs nothing and is the order a hand makes.

48 pass across the three files in both projections.
@ExtraToast
ExtraToast merged commit d3deba0 into main Sep 2, 2026
25 checks passed
@ExtraToast
ExtraToast deleted the test/e2e-affordance-scroll branch September 4, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant