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.
37 lines
924 B
JavaScript
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",
|
|
},
|
|
},
|
|
});
|