(chore) add playwright e2e test

This commit is contained in:
Story Crater Bot
2026-08-18 19:10:51 -07:00
parent 6c6218ef36
commit 3a03a6afb6
7 changed files with 18 additions and 0 deletions
+4
View File
@@ -35,3 +35,7 @@ This repo (`riotpiao`) or the homelab repo. Follows from decision 1 — whicheve
---
Once answered, update this file with the decisions taken (date + rationale) before starting [01-phase0-unblock.md](01-phase0-unblock.md).
## Hard requirement: Playwright
Every phase shipping a UI surface (Phase 2, 3, 4, 5) requires a passing Playwright e2e spec before merge — not optional, gated in CI alongside `pnpm test`. Setup lands in Phase 0 task 0.6a.
+5
View File
@@ -25,6 +25,10 @@ Blocking. Nothing ships until this lands. Requires [00-decisions.md](00-decision
- [ ] **0.6** Add Vitest + Testing Library + `msw`; add `test` and `test:watch` scripts to `package.json`
- Verify: `pnpm test` → runner executes, 0 tests, exit 0
- [ ] **0.6a** Add Playwright (`pnpm create playwright`); add `test:e2e` script to `package.json`; wire into CI as a hard gate (build fails if `test:e2e` fails)
- Playwright is a hard requirement, not optional, for every phase that ships a UI surface (Phase 2, 3, 4, 5) — no surface merges without a passing e2e spec
- Verify: `pnpm test:e2e` → runner executes, 0 tests, exit 0
- [ ] **0.7** Triage unrelated cluster issues: `sms` Application Degraded (`macos-bluebubbles` Pending 3h), `longhorn-config` OutOfSync
- Unrelated to atlas, but delivery tree (Phase 3) will render both red on day one — fix or explicitly accept as known-red
@@ -34,6 +38,7 @@ Blocking. Nothing ships until this lands. Requires [00-decisions.md](00-decision
kubectl get pods -n portfolio # 2/2 Running
curl -sS -o /dev/null -w '%{http_code}\n' https://riotpiao.com # 200
pnpm test # runner executes, 0 tests, exit 0
pnpm test:e2e # runner executes, 0 tests, exit 0
```
Next: [02-phase1-atlas-core.md](02-phase1-atlas-core.md)
+2
View File
@@ -6,6 +6,7 @@
- [ ] `stream_test.go` — SSE emits a delta within 5s of a pod state change
- [ ] `topology.test.tsx` — graph re-renders on delta without a full reload
- [ ] `topology.e2e.ts` (Playwright, hard requirement) — load `/topology`, assert graph nodes render, delete a pod, assert node count updates without reload
## GREEN
@@ -24,6 +25,7 @@
```bash
# delete a pod, observe graph update in <5s without reloading
kubectl delete pod <name> -n <ns>
pnpm test:e2e topology.e2e.ts # required, must pass before merge
```
Next: [04-phase3-delivery.md](04-phase3-delivery.md)
+2
View File
@@ -6,6 +6,7 @@
- [ ] `delivery_test.go` — apps group correctly by `sync-wave`; Secret names absent from output (kind+count only); `repoURL` absent from output
- [ ] `delivery.test.tsx` — 550-node tree renders under frame budget with virtualization on
- [ ] `delivery.e2e.ts` (Playwright, hard requirement) — load `/delivery`, click app node, assert side panel opens with virtualized resource tree, assert no Secret names appear in DOM
## GREEN
@@ -24,6 +25,7 @@
```bash
# trigger an Argo sync, observe wave-ordered animation
argocd app sync homelab-root
pnpm test:e2e delivery.e2e.ts # required, must pass before merge
```
Also in scope for this phase: delete fabricated stats in `app/page.tsx` ("40% CPU reduction", "99.2% uptime", "Mission-critical", "60% latency cut") — wire each card to a real number from `/api/topology` or `/api/delivery`, or remove the claim. Five of six landing cards link to routes that don't exist (`/infrastructure`, `/systems`, `/llm`, `/kafka`, `/opensource`) — fix or remove.
+2
View File
@@ -6,6 +6,7 @@
- [ ] `exec_parse_test.go` — fuzz corpus: every non-allowlisted input rejects and performs zero upstream calls
- [ ] `exec_test.go` — unknown namespace rejects on snapshot membership, not regex
- [ ] `terminal.e2e.ts` (Playwright, hard requirement) — load terminal UI, submit `get nodes`, assert rendered output; submit an injection payload, assert rejection surfaces in UI, zero upstream call
## GREEN
@@ -25,6 +26,7 @@
```bash
# attempt injection payloads against /api/exec; all rejected, all logged
curl -X POST https://riotpiao.com/api/exec -d '{"cmd":"get pods; rm -rf /"}'
pnpm test:e2e terminal.e2e.ts # required, must pass before merge
```
Next: [06-phase5-chat.md](06-phase5-chat.md)
+2
View File
@@ -11,6 +11,7 @@ Depends on [00-decisions.md](00-decisions.md) #4 (is chat in scope for v1).
- [ ] `budget_test.go` — 13th message in 24h returns `429` with `Retry-After`
- [ ] `injection_test.go` — snapshot content cannot alter system-prompt behaviour
- [ ] `context_test.go` — history truncation keeps total tokens under 16384
- [ ] `chat.e2e.ts` (Playwright, hard requirement) — load chat UI, send message, assert streamed tokens render, assert queue position renders under load, assert reasoning block is collapsible
## GREEN
@@ -34,6 +35,7 @@ Depends on [00-decisions.md](00-decisions.md) #4 (is chat in scope for v1).
```bash
# load test at 20 concurrent clients
# GPU sequence usage never exceeds 6, no upstream 5xx, queue drains
pnpm test:e2e chat.e2e.ts # required, must pass before merge
```
## Done — atlas v1 shipped
+1
View File
@@ -30,3 +30,4 @@ Not started. **5 decisions block Phase 1** — see [00-decisions.md](00-decision
- I4: no free-form string reaches an internal system (closed enum, snapshot-membership validation)
- I5: GPU chat concurrency capped at 6 of 8 sequence slots, disconnect cancels upstream immediately
- TDD: RED (tests named before code) → GREEN (minimal code) → REFACTOR, per phase
- Playwright e2e is a hard requirement for every UI-shipping phase (2, 3, 4, 5) — no surface merges without a passing spec