Files
ui/apps/cd/playwright.config.ts
zeekay b67229f82c feat(cd): dedicated Hanzo CD dashboard on @hanzo/gitops (cd.hanzo.ai)
Replace the ArgoCD React fork (deploy/ui, webpack argo-cd-ui) with a focused,
mobile-first CD dashboard built on the shared Hanzo component packages over the
native cloud CD plane (/v1/deploy). Its job stays: see every operator App CR with
stats · sync · health · resource tree · logs · sync/rollback.

- Vite + React 19 STATIC SPA → dist/ (index.html + login.html + CNAME + assets),
  published to the existing s3://cdn/cd static plane cd.hanzo.ai already serves
  (ingress staticFiles/spaMode; /v1/deploy peeled to cloud). No ingress/backend
  change.
- @hanzo/gitops (framework-free ArgoCD-replacement views): GitopsAppList for the
  fleet; GitopsSyncPanel + GitopsAppTree + GitopsNodeInfo + GitopsRollbackDialog
  composed for the app detail (lazy per-node /resource + /logs). Resolved via Vite
  path alias off the built dist so it builds without a full monorepo install.
- src/lib/adapt.ts maps the real /v1/deploy DTOs into the @hanzo/gitops
  view-models, reusing the package's foldHealth/foldSync (strips [-_] so the
  hyphenated 'out-of-sync' folds to OutOfSync, not Unknown).
- Auth: the admin-console PKCE login.html (ported) → hanzo_iam_token cookie the
  cloud binary validates (SuperAdmin gate); same-origin credentialed /v1/deploy.
- Lean self-contained topbar (Geist, small mark, env scope) in the interim; the
  @hanzo/ui-shadcn shared shell + @hanzo/canvas map are registry-install-gated
  follow-ons (the map already ships green in hanzoai/console).
- Verify: tsc 0; vitest 8/8 (adapter + the sync-fold fix); playwright render +
  mobile (no horizontal body scroll at 390).
2026-07-19 12:52:11 -07:00

29 lines
1.0 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test"
/**
* Hanzo CD render + responsive proof. Builds the static SPA and serves it (vite
* preview), then the spec mocks `/v1/deploy/*` + a session cookie and asserts the
* fleet renders, a row opens the ArgoCD-grade detail (sync panel + resource tree),
* and the body never scrolls horizontally at 390px. Screenshots per width.
*
* pnpm --filter cd exec playwright test # builds + serves + runs
* BASE_URL=https://cd.hanzo.ai pnpm … test # against a live deploy
*/
export default defineConfig({
testDir: "./e2e",
timeout: 60_000,
retries: 1,
workers: 1,
reporter: "list",
use: { baseURL: process.env.BASE_URL ?? "http://localhost:4173", headless: true },
webServer: process.env.BASE_URL
? undefined
: {
command: "npx vite build && npx vite preview --port 4173 --strictPort",
url: "http://localhost:4173",
reuseExistingServer: true,
timeout: 120_000,
},
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
})