From a23e425e351ca1ac6647a00b6ce4b5b0f48339d5 Mon Sep 17 00:00:00 2001 From: Zhi Date: Fri, 13 Mar 2026 01:28:16 +0000 Subject: [PATCH] allow BASE_URL and WEB_SERVER_URL env vars --- playwright.config.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index a91a323..350b104 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,5 +1,8 @@ import { defineConfig, devices } from '@playwright/test'; +const baseURL = process.env.BASE_URL || 'http://127.0.0.1:3000'; +const webServerURL = process.env.WEB_SERVER_URL || baseURL; + export default defineConfig({ testDir: './tests', fullyParallel: true, @@ -8,7 +11,7 @@ export default defineConfig({ workers: process.env.CI ? 1 : undefined, reporter: 'html', use: { - baseURL: 'http://127.0.0.1:3000', + baseURL, trace: 'on-first-retry', }, projects: [ @@ -19,7 +22,7 @@ export default defineConfig({ ], webServer: { command: 'npm run dev', - url: 'http://127.0.0.1:3000', + url: webServerURL, reuseExistingServer: !process.env.CI, }, });