import { defineConfig, devices } from "@playwright/test"; import { assertOfficialE2EEnvironment, assertOfficialE2EExecution, } from "./tests/e2e/support/e2e-contract"; const localBaseUrl = "http://127.0.0.1:5173"; assertOfficialE2EExecution(process.env); assertOfficialE2EEnvironment(process.env); export default defineConfig({ testDir: "./tests/e2e", testIgnore: "**/e2e-contract.test.ts", timeout: 30_000, expect: { timeout: 5_000 }, fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, reporter: [["html", { open: "never" }]], use: { baseURL: localBaseUrl, testIdAttribute: "data-testid", trace: "on-first-retry", screenshot: "only-on-failure", video: "retain-on-failure", }, projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }], webServer: [ { command: "node --import=tsx tests/e2e/support/ensure-e2e-database.ts && cd apps/server && node --env-file=.env.e2e --import=tsx src/index.ts", url: "http://127.0.0.1:3002/api/v1/__ready", timeout: 120_000, reuseExistingServer: false, }, { command: "cd apps/web && pnpm dev -- --mode e2e --port 5173", url: localBaseUrl, timeout: 120_000, reuseExistingServer: false, }, ], });