diff --git a/@tooling/e2e/playwright-report/index.html b/@tooling/e2e/playwright-report/index.html index 4eb7a93..819edc8 100644 --- a/@tooling/e2e/playwright-report/index.html +++ b/@tooling/e2e/playwright-report/index.html @@ -87,4 +87,4 @@ Error generating stack: `+l.message+`
- \ No newline at end of file + \ No newline at end of file diff --git a/@tooling/e2e/playwright.config.ts b/@tooling/e2e/playwright.config.ts index aa200c1..31647cb 100644 --- a/@tooling/e2e/playwright.config.ts +++ b/@tooling/e2e/playwright.config.ts @@ -1,17 +1,26 @@ import { createPlaywrightConfig } from '@lilith/playwright-e2e-docker'; +// In Docker e2e, PLAYWRIGHT_BASE_URL is set externally (companion-web container). +// In local dev, fall back to the dev server started via webServer. +const isDockerE2E = Boolean(process.env.PLAYWRIGHT_BASE_URL); +const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? 'http://localhost:5850'; + export default createPlaywrightConfig({ testDir: './e2e', appName: 'companion-web', devicePreset: 'mobile-chrome-only', fullyParallel: true, retries: 1, - baseURL: 'http://localhost:5850', - webServer: { - // Run from monorepo root (two levels up from @tooling/e2e) - command: 'pnpm -C ../.. --filter @companion/web dev', - port: 5850, - reuseExistingServer: true, - timeout: 60000, - }, + baseURL, + ...(isDockerE2E + ? {} + : { + webServer: { + // Run from monorepo root (two levels up from @tooling/e2e) + command: 'pnpm -C ../.. --filter @companion/web dev', + port: 5850, + reuseExistingServer: true, + timeout: 60000, + }, + }), });