Files
glenloch-media/playwright.config.ts
T
Tiel Coder d0a696167f fix(D8): grid slots render, per-cell optimistic revert, shared E2E helpers, admin reset endpoint
- src/db/grid.ts: key role map by ID (was slug, causing all cells to show '—')
- src/components/app/schedule-grid-editor.tsx: revert only failed cell, not entire grid
- src/db/audit.ts: fix import path ./db → @/db
- src/db/seed.ts: add resetAndSeed(), assign Audio only (leave Livestream/Slides open)
- src/auth/config.ts: carry id/email on JWT for audit actor
- e2e/dev.ts: shared signInAs + resetDb helpers
- e2e/schedule-grid.spec.ts: use shared helpers, reset DB beforeAll
- e2e/assign-mutations.spec.ts: E2E for assign/clear with optimistic update + rollback
- src/app/api/dev/reset/route.ts: admin-only DB reset endpoint
- playwright.config.ts: workers: 1 (serial, suites share one Postgres)
2026-11-18 21:51:04 +00:00

36 lines
1.1 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test";
/**
* E2E for the app shell. The done-criteria is "passes at 360px viewport", so
* the shell tests pin a mobile viewport. The webServer builds + starts the app
* against the same Postgres the app uses in production.
*/
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
// Serial: both suites share one Postgres and reset it in beforeAll. Parallel
// workers would truncate mid-read (one suite resets while another reads an
// empty grid), so run one file at a time. The suite is tiny (~2s).
workers: 1,
reporter: "list",
use: {
baseURL: "http://localhost:3000",
trace: "on-first-retry",
},
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
],
webServer: {
command: "pnpm db:migrate && pnpm build && PORT=3000 pnpm start",
url: "http://localhost:3000",
reuseExistingServer: true,
env: {
DATABASE_URL: "postgres://media:media@localhost:5433/media",
NEXTAUTH_SECRET: "e2e-secret-for-shell-tests",
AUTO_ACTIVATE_NEW_USERS: "true",
},
timeout: 180_000,
},
});