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