Files
explicata/playwright.config.ts
T
thalladaandClaude Opus 5.5 5f6ea8e5c9 Auto picks panes from 900 px wide, a laptop's window too, not 1600
One pane and the stack of earlier ones beside it read well from there. The browser tests start in
the column (playwright.config.ts) where they mean it; a panes test lets the layout follow the window
(helpers.ts autoLayout). New: auto gives panes at 1366 and the column at 820 and 390.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
2026-11-16 16:31:21 -05:00

36 lines
1.7 KiB
TypeScript

import { mkdtempSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { defineConfig } from "@playwright/test";
// IE_E2E_PORT lets two runs go side by side.
const PORT = Number(process.env.IE_E2E_PORT ?? 4760);
// Each run gets an empty data directory, so it starts from a freshly seeded document.
const data = process.env.IE_E2E_DATA ?? mkdtempSync(join(tmpdir(), "ie-e2e-"));
process.env.IE_E2E_DATA = data;
export default defineConfig({
testDir: "e2e",
timeout: 60_000,
workers: 1,
reporter: [["list"]],
// The page starts in the column (`/view column`): auto would show panes at this width. A test of
// the panes view sets its own width and lets the layout follow it (helpers.ts `autoLayout`).
use: {
baseURL: `http://localhost:${PORT}`,
viewport: { width: 1440, height: 900 },
storageState: { cookies: [], origins: [{ origin: `http://localhost:${PORT}`, localStorage: [{ name: "ie:settings", value: JSON.stringify({ view: "column" }) }] }] },
},
webServer: {
// The production build with the deterministic mock model: what is measured is the app's
// own pipeline, not a model's speed.
// Each port builds into its own directory: two runs side by side must not rebuild the files the
// other is serving.
command: `npx vite build --outDir dist-e2e-${PORT} --emptyOutDir && npx tsx server/index.ts`,
env: { IE_DIST: `dist-e2e-${PORT}`, IE_PROD: "1", IE_LLM: "mock", IE_MOCK_DELAY: "10", IE_DATA: data, PORT: String(PORT), IE_USER: "tester", IE_WIKI: "mock", IE_EMBED: "fake", IE_WIKI_MOCK_BULK_MS: "60" },
url: `http://localhost:${PORT}/api/state`,
reuseExistingServer: false,
timeout: 60_000,
},
});