feat(test): E2E test suite via browser-deployed SPA — multi-user, multi-project, real-time #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Phase 16 (session 24) demonstrated that the SPA path (
_ui --dist+ socat TCP→UDS bridge) is fully drivable from a headless Chromium. This unlocks the missing top of the test pyramid: actual user-experience tests that exercise enrollment, ticket flows, presence, live updates, attachments, and cross-project isolation against the real wire stack — not just unit + integration tests against the JSON-RPC layer.Goal: "OK it works" confidence. Catch regressions like Phase 17's WebSocket-reactive-dep bug or session-23's Bootstrap-load-mechanism breakage at PR time, not in the user's hands.
Sequencing — depends on #5 (Phase 18)
This issue is Phase 19 in the roadmap, gated by #5 (Phase 18: vision + e2e_checklist + architecture + testing docs). Reason: Phase 18 lands the row-by-row spec matrix (freezone-pattern), and every Playwright spec written here will reference a row in that checklist. Writing tests before the spec rows risks orphan tests with no clear acceptance criterion.
Demo / test infrastructure (8083-8086 scheme)
Per session-24's rebrand:
support@mycelium.comalice@example.comsupport@hero.combob@example.comEach port = separate origin = isolated localStorage = independent logged-in identity (drivable from a single Chromium with multiple BrowserContexts).
Add
carol@example.com/dave@example.comper project for two-customer presence-comparison tests.Deliverables
rebrand.pyintocrates/hero_assistance_server/examples/phase13_seed.rs. Renameacmeprofile →myceliumandglobex→hero. Update workspace names + user emails to the simplified scheme.scripts/phase13_demo.shto also start the 2_ui --distinstances + 4 socat bridges; new--browserflag (default--appfor backward compat).tests/e2e/withplaywright.config.ts+ per-scenario.spec.tsfiles.localStorage["hero_assistance.identity"]persists; F5 keeps you signed inUint8Array→File→ fire programmaticpasteevent; verify upload + inline thumbnail render-32002"Request a new link" affordancemake e2etarget; Forgejo workflow runs E2E on every PR (or nightly if too slow).<1%perceptual diff threshold per D-09. Replaces the manual baseline-recapture step in Phase 16b.docs/dev/testing.md(test-pyramid layering);docs/dev/demo.md(manual exploration runbook for the 4-port browser scheme).D-XX-e2e-test-architecture.md— Playwright + multi-context-per-origin pattern; the seed-rebrand convention; visual-regression policy.Out of scope
Estimated effort
2-3 sessions:
Success criterion
make e2eexits 0 on a clean checkout. Sanity check: intentionally introduce a regression (e.g., revert the Phase 17 WebSocket-reactive-dep fix) and confirm the suite goes red.v0.3.0 shipped — Phase 18c-release closes this issue.
Commit:
39d85e5ondevelopment; tagv0.3.0(annotated).What landed in s29:
Un-skipped
tests/playwright/regression/enrol.spec.ts— three concrete fixes (none of which were the s28-theorised hydration race): log-grep path was relative to test cwd not repo root; Token-step submit button accessible name has a leading space from the icon glyph (regex/^sign in$/i→/sign in/i);parsed.emailassertion replaced withuser_id > 0+role.length > 0sinceIdentityState::Authenticated.emailis intentionallyNonepost-enrolment perenrollment.rs:226. Also added a defensiveclickAndWaitForRpchelper that gates click+RPC onpage.waitForResponsewith a method-name post-data filter and 5-attempt retry — hydration-race insurance even though hydration wasn't the root cause.Un-skipped
tests/playwright/regression/breadcrumb.spec.ts— root cause was stale WASM dist (target/dx/hero_assistance_ui_wasm/release/web/publicwas Apr 30 18:50, predating s27's W8 Breadcrumb landing on May 1). The running_ui --distserved the prior← Back to ticketsad-hoc link instead of the typedBreadcrumbcomponent, sonav[aria-label="breadcrumb"]never matched. Resolved bymake dist; spec body unchanged.Landed 6 L7 SPA baseline PNGs via
scripts/capture-spa-baselines.shagainst the running 4-port demo +hero_browser_serveron:8884:tests/baselines/spa-enroll-{375,768,1920}.png(EnrollmentModal)tests/baselines/spa-home-{375,768,1920}.png(Anonymous CTA)Detail-page capture deferred per script comment — needs identity pre-seed that respects Dioxus 0.7 hydration order.
Flipped 31 Browser?/MCP? cells in
docs/dev/e2e_checklist.mdSections A/C/D/G/L with<test_file>:<test_name>evidence per §Process invariants (every ✅ on a Wired/Browser/MCP cell points at a specific test or capture). Plus 8 Wired? enhancements withtests/e2e_journey.sh:Phase<N>evidence on Section L methods. Plus 6 new rows in Section M (M-15..M-20) for the SPA captures with MCP ✅ viahero_browserMCP capture.Updated
docs/dev/testing.md§2 layer counts: L5 9 active+2 skipped → 11 passing; L7 14 baselines → 20 baselines; total ~381 → ~389.Test posture:
No new decisions; no new limitations. B.5 skip held (doc + spec polish; no wire/protocol/invariant change).
Closing — substrate is engineering-complete pre-customer at the test-pyramid layer.