ghostguild-org/playwright.config.js
Jennie Robinson Faber f428cbb219
Some checks failed
Test / playwright (push) Failing after 13m11s
Test / vitest (push) Successful in 11m11s
Test / visual (push) Failing after 12m7s
Test / Notify on failure (push) Successful in 2s
fix(ci): reuse existing server + downgrade upload-artifact to v3
Playwright's webServer config tried to spin up its own server in CI
('reuseExistingServer: !process.env.CI' = false), but the workflow
already started one manually — port 3000 was busy and Playwright
errored before any test ran. Set reuseExistingServer: true always:
Playwright reuses whatever's responsive and only runs the command
when nothing is.

Forgejo doesn't support actions/upload-artifact@v4 (GHES-not-supported
error). Downgrade to @v3.
2026-05-01 09:40:24 +01:00

37 lines
924 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: true,
env: {
NUXT_PUBLIC_COMING_SOON: "false",
NODE_ENV: "development",
ALLOW_DEV_TEST_ENDPOINTS: "true",
},
},
});