allow BASE_URL and WEB_SERVER_URL env vars

This commit is contained in:
Zhi
2026-03-13 01:28:16 +00:00
parent fd497f7231
commit a23e425e35

View File

@@ -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,
},
});