FactuGES_ERP/playwright.config.ts

45 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-09-10 12:04:03 +00:00
import { defineConfig, devices } from "@playwright/test";
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";
assertOfficialE2EExecution(process.env);
assertOfficialE2EEnvironment(process.env);
2026-09-10 12:04:03 +00:00
export default defineConfig({
testDir: "./tests/e2e",
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: {
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"] } }],
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
});