diff --git a/playwright.config.mjs b/playwright.config.mjs index d5f3cce..c721e0d 100644 --- a/playwright.config.mjs +++ b/playwright.config.mjs @@ -8,7 +8,7 @@ export default defineConfig({ retries: process.env.CI ? 2 : 0, reporter: 'html', use: { - baseURL: 'http://localhost:8888', + baseURL: process.env.CHRNX_E2E_BASE_URL || 'http://localhost:8888', trace: 'on-first-retry', }, projects: [ diff --git a/tests/smoke/e2e-harness.test.mjs b/tests/smoke/e2e-harness.test.mjs index efe9ccf..7cd90f5 100644 --- a/tests/smoke/e2e-harness.test.mjs +++ b/tests/smoke/e2e-harness.test.mjs @@ -2,6 +2,15 @@ import assert from 'node:assert/strict'; import { readFile, readdir } from 'node:fs/promises'; import test from 'node:test'; +test( 'Playwright selects an environment-specific base URL with a root default', async () => { + const config = await readFile( 'playwright.config.mjs', 'utf8' ); + + assert.match( + config, + /baseURL:\s*process\.env\.CHRNX_E2E_BASE_URL\s*\|\|\s*['"]http:\/\/localhost:8888['"]/, + ); +} ); + test( 'Playwright seeds deterministic local fixtures once outside browser workers', async () => { const config = await readFile( 'playwright.config.mjs', 'utf8' ); const setup = await readFile( 'tests/e2e/global-setup.mjs', 'utf8' );