Skip to content

e2e: every test ends at the top of its window - #451

Merged
Nawid3333 merged 2 commits into
mainfrom
fix/e2e-frame-before-navigate
Oct 11, 2026
Merged

Nawid3333 merged 2 commits into
mainfrom
fix/e2e-frame-before-navigate

Conversation

@Nawid3333

Copy link
Copy Markdown
Owner

Main's CI after #450 failed on autoplay-next-episode (Linux). That spec is the second source of today's CI failures.

What the step logs (added in #449) showed. Every hang:

  • comes at the very start of a test, in its first browser.url(), before the first step logs;
  • comes in a test right after one that ended switched into the player's iframe.

A test after one that ended at the window's top never hung. It's a race in the driver, not a rule: the retry once got through the same setup. The navigation replaces the page, and the frame the driver was waiting in disappears with it, until mocha's 120 s timeout.

Fix. A mocha root hook (tests/e2e/setupGuard.mjs) switches to the window's top after every test, in every suite; framed-player.e2e.mjs already did this on its own. A window or session that's already gone is expected and stays quiet. Any other failure of the reset is logged, so a reset that stops working gets noticed. The unit test fails without the hook.

Reviewed by deepseek, kimi and glm:

  • all three confirm the diagnosis from the log;
  • logging unexpected errors and the "race, not a rule" wording are their findings.

Checks: unit e2eHarness 27/27, lint, typecheck, and locally autoplay-next-episode 4/4, framed-player 4/4, content-overlays 8/8.

🤖 Generated with Claude Code

Nawid3333 and others added 2 commits October 11, 2026 23:09
On CI's Linux runner, autoplay-next-episode's tests hung until mocha's
120 s timeout (main after #450, #449's runs; 2026-10-11). The step logs
show where: each hang came in a test's first browser.url(), before its
first step, and each in a test after one that ended switched into the
player's frame (not every such test hung: a race in the driver). The
navigation replaces the page, and the frame the driver waited in goes
with it.

A mocha root hook now switches to the window's top after every test,
in every suite (framed-player.e2e.mjs did it on its own). A window or
session already gone is expected; any other failure of the reset is
logged, so a reset that stops working shows. Reviewed by deepseek, kimi
and glm (the diagnosis; the logging and the wording are their findings).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the root hook, a test no longer starts in the frame the one before
ended in. firefox-vpn's second test clicked the player's VPN button
without switching into the player, relying on the first test to leave
it there - on #451's CI it ran in the page (no button, no
chrome.permissions there), and the third test failed after it (no
permission given). It now enters the player first; its page is the
first test's, nothing navigates. Locally 3/3; deepseek, kimi and glm:
nothing real.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Nawid3333
Nawid3333 merged commit 80b33de into main Oct 11, 2026
25 checks passed
@Nawid3333
Nawid3333 deleted the fix/e2e-frame-before-navigate branch October 11, 2026 21:29
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