Event wizard: how people book (whole course / pick sessions), capacity per session and per-option session mode. Session picker on the public registration page, Manual registration and the kiosk; at the door points to Manual registration. Register, tickets and My Events handle picked sessions. Adds docs/ROADMAP-v2.md and docs/HANDOVER.md so work can carry on from another machine, and a pick-sessions e2e test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
71 lines
2.4 KiB
TypeScript
71 lines
2.4 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
const { e2eDatabaseUrl } = require("./e2e/support/db-url");
|
|
|
|
// End-to-end tests: their own backend (port 5100) and frontend (port 3100) against a
|
|
// separate database that is recreated and seeded on every run (e2e/support/prepare-db.js).
|
|
// Run with `npm run test:e2e`. In CI (CI=true) the frontend is built and started instead
|
|
// of run in dev mode.
|
|
const API_PORT = 5100;
|
|
const WEB_PORT = 3100;
|
|
const ci = !!process.env.CI;
|
|
const databaseUrl = e2eDatabaseUrl();
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
testMatch: "**/*.spec.ts",
|
|
// One shared database, so tests run one after another.
|
|
workers: 1,
|
|
fullyParallel: false,
|
|
retries: ci ? 1 : 0,
|
|
timeout: 120_000,
|
|
expect: { timeout: 20_000 },
|
|
reporter: ci ? [["list"], ["html", { open: "never", outputFolder: "e2e/report" }]] : "list",
|
|
outputDir: "e2e/test-results",
|
|
use: {
|
|
baseURL: `http://localhost:${WEB_PORT}`,
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
// Dev-mode pages compile on first visit.
|
|
navigationTimeout: 90_000,
|
|
},
|
|
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
|
|
webServer: [
|
|
{
|
|
command: "node ../e2e/support/prepare-db.js && node src/index.js",
|
|
cwd: "backend",
|
|
url: `http://localhost:${API_PORT}/api/settings/needs-setup`,
|
|
timeout: 180_000,
|
|
reuseExistingServer: !ci,
|
|
stdout: "ignore",
|
|
stderr: "pipe",
|
|
env: {
|
|
PORT: String(API_PORT),
|
|
DATABASE_URL: databaseUrl,
|
|
E2E_DATABASE_URL: databaseUrl,
|
|
FRONTEND_URL: `http://localhost:${WEB_PORT}`,
|
|
APP_BASE_URL: `http://localhost:${WEB_PORT}`,
|
|
JOBS_ENABLED: "false",
|
|
SCHEDULED_EMAILS_ENABLED: "false",
|
|
// The kiosk test signs a supervisor in with a password (no 2FA code by email).
|
|
TWO_FACTOR_REQUIRED_ROLES: "false",
|
|
},
|
|
},
|
|
{
|
|
command: ci ? `npm run build && npx next start -p ${WEB_PORT}` : `npx next dev -p ${WEB_PORT}`,
|
|
cwd: "frontend",
|
|
url: `http://localhost:${WEB_PORT}`,
|
|
timeout: 600_000,
|
|
reuseExistingServer: !ci,
|
|
stdout: "ignore",
|
|
stderr: "pipe",
|
|
env: {
|
|
NEXT_PUBLIC_API_URL: `http://localhost:${API_PORT}`,
|
|
API_URL: `http://localhost:${API_PORT}`,
|
|
NEXT_DIST_DIR: ci ? ".next" : ".next-e2e",
|
|
NEXT_TELEMETRY_DISABLED: "1",
|
|
},
|
|
},
|
|
],
|
|
});
|