test(e2e): make Playwright BASE_URL-overridable + record Phase 2 e2e baseline
- playwright.config.ts: honor BASE_URL env (and skip the auto-started webServer when set) so a server booted from a specific worktree on a non-default port can be tested without fighting over :3333. - skill test-recipes.md: record the recipe for running e2e from a non-default worktree (in-process test server + reseed helper) and the measured baseline on the merged hx-select reference: swap-doctrine 6/6 green; transaction-edit.spec.ts has a pre-existing Shared-Location save failure that masks 7 via serial mode; full suite 30 pass / 2 fail / 7 skip. Gate for the refactor = swap spec + REPL pure-fn checks.
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
// Allow pointing the suite at an already-running test server (e.g. one booted from a
|
||||
// specific worktree on a non-default port) via BASE_URL. When BASE_URL is set we skip
|
||||
// the auto-started webServer entirely, so parallel worktrees don't fight over :3333.
|
||||
const baseURL = process.env.BASE_URL ?? 'http://localhost:3333';
|
||||
const useExternalServer = !!process.env.BASE_URL;
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
fullyParallel: true,
|
||||
@@ -8,15 +14,17 @@ export default defineConfig({
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
reporter: 'html',
|
||||
use: {
|
||||
baseURL: 'http://localhost:3333',
|
||||
baseURL,
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
webServer: {
|
||||
command: 'lein run -m auto-ap.test-server',
|
||||
url: 'http://localhost:3333/test-info',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 120000,
|
||||
},
|
||||
webServer: useExternalServer
|
||||
? undefined
|
||||
: {
|
||||
command: 'lein run -m auto-ap.test-server',
|
||||
url: 'http://localhost:3333/test-info',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 120000,
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
|
||||
Reference in New Issue
Block a user