diff --git a/playwright.config.ts b/playwright.config.ts index 6c1afe77..a617b13d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -74,6 +74,7 @@ export default defineConfig({ stderr: 'pipe', env: { VITE_OPEN_BROWSER: 'false', + PORT: '3000', // Force port 3000 for E2E tests (prevents auto-increment) }, }, diff --git a/vite.config.ts b/vite.config.ts index 09f3ec75..01828b7b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -81,6 +81,7 @@ export default defineConfig(({ mode }) => { // Development server server: { port: env.PORT ? parseInt(env.PORT) : 3000, // Use PORT env var or default to 3000 + strictPort: isCI, // Fail if port unavailable on CI (prevents Playwright port mismatch) host: true, open: shouldAutoOpen && !isCI,