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, workers: process.env.CI ? 1 : undefined, 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, }, });