ghostguild-org/playwright.config.js
Jennie Robinson Faber b9fa9f603c fix(e2e): rebuild auth helpers + tune playwright config
Login helpers now hit dev endpoints via APIRequestContext instead of
page.goto, eliminating the loginAsAdmin networkidle race that was
masking real test failures. Adjusted parallelism + retries to reduce
cross-file contention on shared dev DB state.
2026-04-30 22:25:28 +01:00

37 lines
935 B
JavaScript

import { defineConfig } from "@playwright/test";
const PORT = process.env.PLAYWRIGHT_PORT || "3000";
const BASE_URL = `http://localhost:${PORT}`;
export default defineConfig({
testDir: "./e2e",
outputDir: "e2e/test-results",
snapshotDir: "e2e/__screenshots__",
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 1,
workers: process.env.CI ? 1 : 4,
reporter: "html",
timeout: 60000,
use: {
baseURL: BASE_URL,
trace: "on-first-retry",
navigationTimeout: 45000,
},
projects: [
{
name: "chromium",
use: { browserName: "chromium" },
},
],
webServer: {
command: `PORT=${PORT} npm run build && PORT=${PORT} NODE_ENV=development npm run preview`,
url: BASE_URL,
reuseExistingServer: !process.env.CI,
env: {
NUXT_PUBLIC_COMING_SOON: "false",
NODE_ENV: "development",
ALLOW_DEV_TEST_ENDPOINTS: "true",
},
},
});