Files
bricktrack/playwright.screenshots.config.ts
unknownandClaude Opus 5 b1fc502d55 docs: readme, schnellstart, bebilderte anleitung und changelog 0.1.0
QUICKSTART fuehrt von null zur laufenden Instanz und enthaelt die
vollstaendige Nginx-Proxy-Manager-Konfiguration - inklusive der beiden
Stellen, an denen es sonst klemmt: client_max_body_size fuer grosse
Anleitungs-PDFs und X-Forwarded-For fuer das Rate-Limit.

Die Anleitung ist bebildert. Die 16 Screenshots entstehen automatisiert
mit `pnpm screenshots` gegen das Produktions-Image im Container, nicht
gegen den Dev-Server: der brach unter Last reproduzierbar mit
ChunkLoadError ab, und die Bilder zeigen so ohnehin genau das, was nach
`docker compose up` zu sehen ist.

Nebenbei behoben: in der Mehrfachauswahl verdeckte die Aktionsleiste die
letzte Kachelreihe.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 00:48:32 +02:00

54 lines
1.5 KiB
TypeScript

import path from 'node:path';
import { defineConfig, devices } from '@playwright/test';
/**
* Produces the screenshots for docs/ANLEITUNG.md.
*
* Runs against the production container, not the dev server: the dev server
* compiles routes on demand, which made the capture run flaky, and the manual
* should show exactly what a user gets after `docker compose up`.
*
* pnpm screenshots
*/
const PORT = 3220;
const BASE_URL = `http://localhost:${PORT}`;
// Docker wants forward slashes, also on Windows.
const dataDir = path.resolve(process.cwd(), 'data-shots').replace(/\\/g, '/');
export default defineConfig({
testDir: './e2e',
testMatch: 'screenshots.spec.ts',
fullyParallel: false,
workers: 1,
// The run registers a user, so a second attempt would start from a state
// that no longer matches the script.
retries: 0,
timeout: 300_000,
expect: { timeout: 30_000 },
reporter: 'list',
use: {
baseURL: BASE_URL,
locale: 'de-DE',
timezoneId: 'Europe/Berlin',
// A phone, because that is how the app is actually used.
...devices['Pixel 7'],
},
webServer: {
command: [
'docker run --rm --name bricktrack-shots',
`-p ${PORT}:3000`,
`-e BASE_URL=${BASE_URL}`,
'-e BETTER_AUTH_SECRET=screenshot-run-secret-0123456789abcdefgh',
'-e TZ=Europe/Berlin',
`-v "${dataDir}:/data"`,
'bricktrack:shots',
].join(' '),
url: `${BASE_URL}/api/health`,
reuseExistingServer: false,
timeout: 180_000,
stdout: 'pipe',
stderr: 'pipe',
},
});