import { defineConfig } from "@playwright/test"; // Allow overriding the dev-server port via NOTELETT_WEB_PORT so contributors // whose host already has port 3000 occupied (Grafana, another product's // web app, etc.) can run E2E without port conflicts that would otherwise // silently test against the wrong app. const port = Number(process.env.NOTELETT_WEB_PORT ?? 3000); const baseURL = `http://localhost:${port}`; export default defineConfig({ testDir: "./e2e", fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: "html", use: { baseURL, trace: "on-first-retry", }, webServer: { command: `PORT=${port} pnpm run dev`, url: baseURL, reuseExistingServer: !process.env.CI, timeout: 120_000, }, });