2026-09-10 12:04:03 +00:00
|
|
|
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
|
|
2026-09-22 14:49:08 +00:00
|
|
|
import {
|
|
|
|
|
assertOfficialE2EEnvironment,
|
|
|
|
|
assertOfficialE2EExecution,
|
|
|
|
|
} from "./tests/e2e/support/e2e-contract";
|
|
|
|
|
|
2026-09-10 12:04:03 +00:00
|
|
|
const localBaseUrl = "http://127.0.0.1:5173";
|
2026-09-22 14:49:08 +00:00
|
|
|
assertOfficialE2EExecution(process.env);
|
|
|
|
|
assertOfficialE2EEnvironment(process.env);
|
2026-09-10 12:04:03 +00:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
testDir: "./tests/e2e",
|
2026-09-22 14:49:08 +00:00
|
|
|
testIgnore: "**/e2e-contract.test.ts",
|
2026-09-10 12:04:03 +00:00
|
|
|
timeout: 30_000,
|
|
|
|
|
expect: { timeout: 5_000 },
|
|
|
|
|
fullyParallel: true,
|
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
|
retries: process.env.CI ? 2 : 0,
|
|
|
|
|
reporter: [["html", { open: "never" }]],
|
|
|
|
|
use: {
|
2026-09-22 14:49:08 +00:00
|
|
|
baseURL: localBaseUrl,
|
2026-09-10 12:04:03 +00:00
|
|
|
testIdAttribute: "data-testid",
|
|
|
|
|
trace: "on-first-retry",
|
|
|
|
|
screenshot: "only-on-failure",
|
|
|
|
|
video: "retain-on-failure",
|
|
|
|
|
},
|
|
|
|
|
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
|
2026-09-22 14:49:08 +00:00
|
|
|
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,
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-09-10 12:04:03 +00:00
|
|
|
});
|