fix: page a list that appends at the end, and retry a screenshot after navigation
Merged
OK
13d ago+122+122+012345678901234567890123456789-18-18-01234567890123456789
Two failures on main, both a timer that returned before the page had caught up.
scroll_to({ text })treated two polls of an unchanged screen as the end of the list. On the Playwright 1.65 runner, the web agent recording for infinite-scroll died there: 13 screens, stopped at item 60 while "Loading more" was still up,REPLAY_STALE(action-failed,LOCATOR_NOT_FOUND). An unchanged page is re-read for a second after the first held-still look, so an append that lands in that second keeps the paging going.docs/reference/agent.mdx.app.screenshotalready retries when the document is replaced, but only afterframenavigatedhas been delivered. Node 24's spec job rejectedpage.screenshotwith "Execution context was destroyed" before that event, so the shot failed instead of capturing the new document. The capture waits up to 250ms for the event, then takes the new document.
Verified
Ran it locally: yes
The new tests failed on the old code and pass on this branch.
| main | this branch |
|---|---|
scroll_to of a page that turns 400ms after the swipe: LOCATOR_NOT_FOUND in 378ms | passes, 2 swipes, finds Row 7 |
screenshot whose framenavigated arrives on the next macrotask: ENGINE_FAILURE | masked capture, page.screenshot called twice |
$ pnpm --filter e2e exec vitest run --project integration tests/integration/agent-scroll-pages.test.ts tests/integration/agent-scroll-settle.test.ts tests/integration/agent-scroll-smooth.test.ts
Test Files 3 passed (3)
Tests 20 passed (20)
$ pnpm --filter @e2e-dev/web exec vitest run --project integration tests/integration/screenshot-navigation.test.ts
Test Files 1 passed (1)
Tests 6 passed (6)
Also green: e2e and web unit tests, the web integration suite (383 passed, 1 skipped), lint, typecheck for both packages, dead-code, changeset bumps, docs anchors and mdx.
Infinite-scroll's committed recording replayed twice here under --strict-cache (3.7s, 3.8s). This machine is slower than the CI runner that failed the same recording in 1.1s, so the 400ms test is the one that forces the gap.

