Files
History/playwright.config.ts
T
kamilkrzywdaandOpenCode e2936e85bb History: AI-driven alternate-history simulator
Pax Historia-style sim where the LLM is the world engine.

- React 19 + Vite 6 + Tailwind v4 + shadcn/ui frontend
- Express single-port backend (/api + /sse + built client + SPA fallback)
- SQLite (better-sqlite3) persistence, one row per game
- MapLibre choropleth map (OpenFreeMap dark + ISO_A3 regions)
- Defensive turn loop: strip fences, balanced-{} extract, parse, clamp 0-100,
  retry-once nudge, generic 'unclear' fallback; never crashes on bad output
- 5 seed presets (wwii-1939, coldwar-1955, modern-2025, no-wwii-1940, aegis-2400)
- LLM client over native fetch w/ injectable transport (mesh-bot pattern);
  LLM_STUB=1 deterministic transport for tests/e2e
- Unit (vitest, 19) + deterministic Playwright e2e
- Multi-stage node:22-slim Docker + Traefik (history.dev.kkhost.pl:4321)

Co-Authored-By: OpenCode <opencode@users.noreply.github.com>
2026-10-10 21:20:23 +00:00

34 lines
998 B
TypeScript

import { defineConfig } from '@playwright/test';
// Deterministic e2e: the dev webServer runs with LLM_STUB=1 so the Express backend
// uses the canned, deterministic turn simulator (no live LLM in e2e — see
// server/stub.ts). Dev ports default to the spec values but can be overridden via
// VITE_PORT / HISTORY_API_PORT so the run can dodge a port another project holds.
const vitePort = Number(process.env.VITE_PORT ?? 5173);
const apiPort = Number(process.env.HISTORY_API_PORT ?? 4321);
const devUrl = `http://localhost:${vitePort}`;
export default defineConfig({
testDir: './e2e',
fullyParallel: false,
workers: 1,
timeout: 60000,
expect: { timeout: 10000 },
use: {
baseURL: devUrl,
headless: true,
},
webServer: {
command: 'npm run dev',
url: devUrl,
reuseExistingServer: true,
timeout: 120000,
env: {
LLM_STUB: '1',
DATA_DIR: 'data/e2e',
VITE_PORT: String(vitePort),
HISTORY_API_PORT: String(apiPort),
},
},
});