molecule-core/canvas/e2e
Hongming Wang c2504d9361 fix(e2e): page.goto waitUntil networkidle never settles — switch to domcontentloaded
Fifth E2E bug surfaced by the previous run. After the four setup-
phase fixes (instance_status, DNS zone, X-Molecule-Org-Id, hydration
selector) plus CP#259 ending the pq cache class, the harness finally
reached the actual page navigation step — and timed out there:

  TimeoutError: page.goto: Timeout 45000ms exceeded.
    navigating to "https://...staging.moleculesai.app/", waiting until "networkidle"

`waitUntil: "networkidle"` waits for 500ms of network silence. The
canvas keeps a WebSocket connection open + polls /events and
/workspaces every few seconds for status updates, so the network
is never idle — page.goto sits on it until the default 45s timeout
and throws.

Fix: switch to `waitUntil: "domcontentloaded"`. Returns as soon as
the HTML is parsed. React hydration plus the existing
`waitForSelector` line below is what actually gates ready-for-
interaction; the goto's job is just to land on the page.

This is a generally-applicable lesson — networkidle is broken for
any SPA with a heartbeat. Notably, our existing canvas unit tests
that mock @xyflow/react and don't open WebSockets DON'T hit this,
which is why this only surfaces against staging.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 19:43:46 -07:00
..
chat-separation.spec.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
context-menu-delete.spec.ts feat(canvas/e2e): add Playwright test for context-menu → delete confirm flow (#1344) 2026-04-21 08:11:48 +00:00
filestab-smoke.spec.ts test(e2e): add Playwright smoke for FilesTab split 2026-04-13 18:14:54 -07:00
org-template-import.spec.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
staging-setup.ts fix(e2e): send X-Molecule-Org-Id header — TenantGuard 404s without it 2026-04-24 18:13:13 -07:00
staging-tabs.spec.ts fix(e2e): page.goto waitUntil networkidle never settles — switch to domcontentloaded 2026-04-24 19:43:46 -07:00
staging-teardown.ts fix(e2e): CP DELETE /cp/admin/tenants body uses 'confirm', not 'confirm_token' 2026-04-21 04:50:28 -07:00