Skip to content

test(e2e): EPIC-21 validation — smoke coverage for new capabilities and R1 reload flake - #2386

Merged
steilerDev merged 2 commits into
betafrom
test/2190-e2e-validation
Dec 1, 2026
Merged

steilerDev merged 2 commits into
betafrom
test/2190-e2e-validation

Conversation

@steilerDev

@steilerDev steilerDev commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • EPIC-21 E2E validation: one known flake fixed, no regressions found.
  • R1's second page.reload() can reject with 'Not attached to an active page' on Playwright 1.65. Both reloads now tolerate that, and a window.__r1BeforeReload marker set before them, checked with waitForFunction after them, proves a new document loaded. The URL and heading assertions alone would pass on the old document until its delayed /login redirect.
  • @smoke tag on one existing test each in command-search, new-menu, financing-page, task-page, capture-screen and companies-list, so the smoke run covers the new capabilities.

E2E triage

Finding Class Action
R1 double reload rejects with "Not attached to an active page" Known flake (Playwright 1.65) Fixed in this PR
FC1 Already fixed Fixed by #2376
Regressions None —

Coverage summary

  • All 66 EPIC-21 sub-issues map to E2E specs.
  • All 42 served routes have E2E coverage.
  • PENDING_SURFACES in e2e/fixtures/figureSurfaces.ts is empty.
  • The accessibility sweep (e2e/fixtures/a11yPages.ts) is enforced.

Test plan

  • Quality Gates green (includes the E2E smoke run with the new @smoke tests)
  • E2E Gates green (bash scripts/ci-wait.sh <pr> main)

Refs #2190

Capability ids: none

Co-Authored-By: Claude e2e-test-engineer noreply@anthropic.com
Co-Authored-By: Claude dev-team-lead noreply@anthropic.com

🤖 Generated with Claude Code

…nd R1 reload flake

- Session check resilience R1: both reloads tolerate a cancelled navigation
  ("Not attached to an active page", Playwright 1.65); the URL and heading
  assertions prove the session survived.
- Tag one existing test each as @smoke in command-search, new-menu,
  financing-page, task-page, capture-screen and companies-list.

Refs #2190

Co-Authored-By: Claude e2e-test-engineer <noreply@anthropic.com>
Co-Authored-By: Claude dev-team-lead <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@steilerDev

Copy link
Copy Markdown
Owner Author

VERDICT: REQUEST_CHANGES

[product-architect] Request changes: 1 finding, labeled fix-in-session.

Finding 1 (Medium, fix-in-session): the R1 double-reload assertions can now pass against the old document

File: e2e/tests/auth/session-check-resilience.spec.ts, lines 82-90.

Before this PR, await page.reload() waited for the load event of a new document. The heading assertion then proved two things: the reload happened, and the fail-closed guard let the new session check through.

With .catch(() => undefined) on the second reload, the test continues when that reload rejects. At that moment the page still shows the document from the last navigation pair: URL ROUTES.budget, h1 "Money". All three assertions match that old DOM at once:

  • toHaveURL(ROUTES.budget) matches, because the URL does not change on a reload.
  • not.toHaveURL(/\/login/) matches, because a redirect to sign-in comes about 400 ms later (delaySessionCheck).
  • The "Money" h1 is visible, because it is still the old h1.

So the double-reload part of R1 can pass without a reloaded document ever having rendered. The PR body and the code comment say the assertions "still prove that the session survived". That is not true while the old document can satisfy them.

Fix: mark the old document before the reloads. Then wait until a new document replaces it, before you assert. page.waitForFunction re-runs in the new execution context after a navigation, so a torn-down context does not break it:

await page.evaluate(() => {
  (window as Window & { __r1BeforeReload?: true }).__r1BeforeReload = true;
});
await page.reload({ waitUntil: 'commit' }).catch(() => undefined);
await page.reload().catch(() => undefined);
// A new document replaced the marked one: the reload really happened
await page.waitForFunction(
  () => !(window as Window & { __r1BeforeReload?: true }).__r1BeforeReload,
);
await expect(page).toHaveURL(ROUTES.budget);
// ...the existing not-/login and "Money" h1 assertions

With this change, the "Money" h1 again proves that the guard passed in the reloaded document. Also update the code comment, the PR body bullet and the new memory entry in .claude/agent-memory/e2e-test-engineer/known-flakes-and-regressions.md, which repeat the claim "the URL and heading assertions ... prove the session survived". Each should name the marker wait as the proof.

Checked, no findings

  • Smoke tags (6 tests): a whitespace-insensitive diff against the merge base shows only the { tag: '@smoke' } option and the Prettier re-wrap of each signature. Test bodies are unchanged.
  • Desktop-only smoke run (--grep @smoke --project desktop): N1 is inside the desktop menu describe, which skips below 1024px, so it runs on desktop. L1 branches on isTableSurface(), which is true on desktop. S6, F1, the task Start+Undo test and capture scenario 6 make no viewport assumptions. Each test seeds its own data under testPrefix or a tag and cleans it up. N1 reads only the static menu rows; the company created by the describe's beforeAll belongs to the describe and is not shared from another test.
  • Privacy: scan-privacy --profile full is clean on the PR text. The memory file contains no real data.

Set a window.__r1BeforeReload marker before the double reload and wait for
it to be gone afterwards, so the URL and heading assertions run on the new
document rather than the old one before its delayed /login redirect.

Refs #2190

Co-Authored-By: Claude e2e-test-engineer <noreply@anthropic.com>
Co-Authored-By: Claude dev-team-lead <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@steilerDev

Copy link
Copy Markdown
Owner Author

VERDICT: APPROVE

[product-architect] Round 2: approve, zero findings.

Finding 1 from round 1 is resolved in 13d227b:

  • page.evaluate sets window.__r1BeforeReload on the old document before the two tolerated reloads. page.waitForFunction(() => !window.__r1BeforeReload) then waits until a new document replaces it, and it re-runs in the new execution context after a navigation. The URL, not-/login and "Money" h1 assertions therefore run against a reloaded document, and the fail-closed guard again proves the session survived. R1's assertion is no longer weakened.
  • The declare global { interface Window { __r1BeforeReload?: boolean } } augmentation is valid, because the spec is a module. No other file in e2e/ declares the same name.
  • The code comment, the memory note and the PR body now name the marker wait as the proof. They also say why URL and heading checks alone are not proof.
  • The commit carries the e2e-test-engineer trailer. scan-privacy --profile full reports the PR text clean.

The round-1 checks still hold: the 6 smoke tags are only the @smoke option plus Prettier re-wrapping, and they are safe in the desktop-only smoke run.

@steilerDev
steilerDev merged commit 1871122 into beta Dec 1, 2026
29 of 30 checks passed
@steilerDev
steilerDev deleted the test/2190-e2e-validation branch December 1, 2026 00:06
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.19.0-beta.96 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant