Files
serverAppConfigs/tests/e2e/playwright.config.ts
T
Frank 25f387dd76 tests: gate the hermes vhost, and stop specs from silently not running
Two gaps behind the same near-miss.

1. **No spec covered hermes.franksdank.cloud** — the one guarded vhost whose
   upstream is a host address (`reverse_proxy 192.168.0.143:8787`) rather than a
   container name, because its service is host-networked. That is how a
   loopback-only bind could take the vhost down with a 502 and leave every gate
   green. tests/e2e/specs/17-hermes-vhost.spec.ts asserts what a dead upstream
   violates: no 5xx through the guard chain, no Caddy error page, and no app
   bytes to an unauthenticated raw client. It does not assert SSO-silence, since
   this app has its own password login.

2. **Specs are matched by number prefix, not globbed.** A spec file whose prefix
   is in no project silently never runs — which is exactly what happened to the
   new one until it was registered. The prefix is registered now, the comment in
   playwright.config.ts says why, and tests/e2e_scaffold.bats fails if any
   spec file matches no project.

The hermes-webui seam assertion is corrected too: it asserted the loopback bind
I wrongly imposed, and now asserts the real contract — the unit's bind must serve
the address the Caddyfile fronts it on.
2026-09-16 07:33:38 -07:00

49 lines
1.4 KiB
TypeScript

import { defineConfig } from "@playwright/test";
import { BASE_URL, REAL_UA } from "./lib/env";
export default defineConfig({
testDir: "./specs",
timeout: 90_000,
expect: { timeout: 20_000 },
retries: 1,
workers: 2,
fullyParallel: false,
reporter: [["list"]],
outputDir: "./test-results",
use: {
baseURL: BASE_URL,
userAgent: REAL_UA,
ignoreHTTPSErrors: true,
viewport: { width: 1440, height: 900 },
trace: "retain-on-failure",
},
projects: [
{
name: "setup",
testMatch: /00-auth\.setup\.ts/,
},
{
name: "standard",
// NOTE: specs are matched by NUMBER PREFIX, not globbed. A spec file
// whose prefix is not listed in any project silently never runs — a
// green suite with a test that does not exist. 17- joined on 2026-09-16
// (the hermes vhost, whose upstream is a host address rather than a
// container name, so it needs its own pass condition).
testMatch: /(10|12|13|16|17)-.*\.spec\.ts/,
use: { storageState: ".auth/qa-e2e.json" },
dependencies: ["setup"],
},
{
name: "admin",
testMatch: /11-.*\.spec\.ts/,
use: { storageState: ".auth/qa-e2e-admin.json" },
dependencies: ["setup"],
},
{
name: "guest",
testMatch: /(14|15)-.*\.spec\.ts/,
use: { storageState: { cookies: [], origins: [] } },
},
],
});