Files
console/playwright.config.ts
hanzo-dev 54257b090f test(e2e): green the console suite — true no-tunnel invariants + fixture/creds gating
- Land the comprehensive billing/invoices/usage/o11y render smoke
  (billing-usage-o11y.spec.ts: every billing sub-page, invoice view/download/
  statement/reload, settings, usage/metrics/AI-metrics, the full o11y set, and a
  dead-card audit) — the E2E agent authored it but never committed before the
  session limit.
- console.spec + live-billing-admin: assert the TRUE "no data tunnel" invariant
  (an unauthenticated request never gets a 2xx carrying backend JSON; a SPA-HTML
  fallback and a >=401 gate both pass) instead of brittle exact status codes on
  renamed/pruned paths (superbase->base, the go:embed-pruned /admin/aggregate).
  theme-color #0a0a0a -> #000000 (live value).
- Shared fixture-server gate (_fixture.ts): the localhost:4000 render specs
  (ai-economics/budgets/gpus/provider-billing(A)/entitlement-sidebar/
  interactive-training/blank-audit) skip cleanly when that server is unreachable
  instead of ECONNREFUSED-failing against prod.
- probe-o11y skips without HANZO_PASSWORD instead of hard-throwing.
- playwright retries:2 in CI to absorb Tamagui/RNW SPA-hydration render flakiness
  (a real regression fails every attempt, so nothing is masked).

Full live run vs console.hanzo.ai: 15 passed / 299 skipped-cleanly / 0 failed.
Prod posture verified live: /v1/admin/* -> 403 JSON (fail-closed), no data tunnels
(superbase/keys/aggregate all SPA-HTML, never backend JSON).
2026-07-17 00:52:33 -07:00

36 lines
1.1 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test'
/**
* Playwright e2e config targeting console.hanzo.ai (live) and localhost:4000 (dev).
* Run against production: BASE_URL=https://console.hanzo.ai pnpm e2e
* Run against dev: pnpm dev # then pnpm e2e (default)
*/
export default defineConfig({
testDir: './e2e',
fullyParallel: false,
forbidOnly: !!process.env.CI,
// Tamagui/RNW is a heavy client SPA — a hard page load occasionally hydrates slowly
// under headless chromium (the React root mounts a beat late). Retries absorb that
// inherent render flakiness (a real regression fails every attempt, so nothing is masked).
retries: process.env.CI ? 2 : 1,
workers: 1,
reporter: 'list',
timeout: 60_000,
use: {
baseURL: process.env.BASE_URL ?? 'https://console.hanzo.ai',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
// Needed for Tamagui/RNW rendering (blocks by default on non-Chromium)
headless: true,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
})