ghostguild-org/playwright.config.js
Jennie Robinson Faber e260ed5b37 test(visual): allow playwright port override and rebaseline connections-mobile
Add PLAYWRIGHT_PORT env var to playwright.config.js so a worktree can run
its own dev server on a different port without disrupting the main dev
server. Rebaseline connections-mobile-auth which had drifted from the
suggestions data state captured during Phase 1.
2026-04-08 16:03:48 +01:00

37 lines
942 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: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: process.env.CI ? 1 : undefined,
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",
},
},
});