From 69ceb56316990dd2f145d4128a9265662158d0a0 Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Mon, 4 May 2026 17:44:36 +0700 Subject: [PATCH] fix: harden e2e server readiness --- playwright.config.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index f2eec1f..b020b77 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -12,7 +12,7 @@ if (!process.env.CI) { const API_PORT = process.env.API_PORT ?? '3001'; const WEB_PORT = process.env.WEB_PORT ?? '3000'; -const SERVER_STARTUP_TIMEOUT_MS = process.env.CI ? 180_000 : 60_000; +const SERVER_STARTUP_TIMEOUT_MS = process.env.CI ? 300_000 : 60_000; /** * Playwright E2E configuration for Goodgo Platform. @@ -91,10 +91,12 @@ export default defineConfig({ webServer: [ { + name: 'GoodGo API', command: `PORT=${API_PORT} pnpm --filter @goodgo/api run dev`, - url: `http://localhost:${API_PORT}/api/v1/docs`, + port: Number(API_PORT), reuseExistingServer: !process.env.CI, timeout: SERVER_STARTUP_TIMEOUT_MS, + stdout: process.env.CI ? 'pipe' : 'ignore', env: { ...process.env as Record, NODE_ENV: 'test', @@ -103,11 +105,13 @@ export default defineConfig({ }, }, { + name: 'GoodGo Web', command: `pnpm exec next dev --port ${WEB_PORT}`, cwd: './apps/web', - url: `http://localhost:${WEB_PORT}`, + port: Number(WEB_PORT), reuseExistingServer: !process.env.CI, timeout: SERVER_STARTUP_TIMEOUT_MS, + stdout: process.env.CI ? 'pipe' : 'ignore', env: { ...process.env as Record, PORT: WEB_PORT,