repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

docs: record shared playwright test infrastructure

b04e4c09dc1ce2179743fb0cae7a0c4351d62c57

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (1)

docs/super/plans/2026-07-12-mise-task-architecture-phase-2-existing-e2e-and-aggregate.md

Modified
19 19 **Create:**
21 -- `playwright.base.ts`: shared Chromium, Firefox, and headless policy.
21 +- `test/playwright.base.ts`: shared Chromium, Firefox, and headless policy.
22 22 - `extensions/diff-review/mise.toml`: diff-review E2E ownership.
23 23 - `extensions/ui/mise.toml`: UI E2E ownership.
28 28 - `extensions/ui/playwright.config.ts`: UI overlay on the shared browser base without a Windows-only executable override.
29 29 - `extensions/diff-review/package.json`: remove duplicate `test:e2e` script ownership.
30 30 - `extensions/ui/package.json`: remove duplicate `test:e2e` script ownership.
31 +- `scripts/extensions.mjs`: allow Playwright configs to import root test infrastructure without weakening production extension isolation.
32 +- `scripts/test_extensions_static_check.mjs`: regress the narrow Playwright-config allowance.
31 33 - `mise.toml`: replace public browser-install and diff-review-specific tasks with aggregate `e2e`.
32 34 - `AGENTS.md`: document the aggregate root task and qualified local tasks.
33 35 - `extensions/diff-review/README.md`: document local and root-qualified E2E usage.
45 47 **Files:**
47 -- Create: `playwright.base.ts`
49 +- Create: `test/playwright.base.ts`
48 50 - Modify: `extensions/diff-review/playwright.config.ts`
49 51 - Modify: `extensions/ui/playwright.config.ts`
52 +- Modify: `scripts/extensions.mjs`
53 +- Test: `scripts/test_extensions_static_check.mjs`
51 55 - [ ] **Step 1: Record unrelated work before editing**
75 79 - [ ] **Step 3: Create the shared browser base**
77 -Create `playwright.base.ts`:
81 +Create `test/playwright.base.ts`:
79 83 ```ts
80 84 import { defineConfig } from "@playwright/test";
100 104 import { defineConfig } from "@playwright/test";
101 -import base from "../../playwright.base.ts";
105 +import base from "../../test/playwright.base.ts";
103 107 export default defineConfig(base, {
104 108 testDir: "__e2e__",
118 122 import { defineConfig } from "@playwright/test";
120 -import base from "../../playwright.base.ts";
124 +import base from "../../test/playwright.base.ts";
122 126 export default defineConfig(base, {
123 127 testDir: "./__e2e__",
132 136 Delete the `node:fs` import and hard-coded Windows Chrome path.
133 137 Playwright’s installed Chromium must be used consistently on every platform.
135 -- [ ] **Step 6: Verify both projects are discovered**
139 +- [ ] **Step 6: Add a failing static-check regression for shared test infrastructure**
141 +Add a temporary extension with `playwright.config.ts` importing `../test/playwright.base.ts` to `scripts/test_extensions_static_check.mjs`, then assert `staticCheck()` returns no errors.
142 +Run `node scripts/test_extensions_static_check.mjs`.
143 +Expected: FAIL with `cross-extension relative import ../test/playwright.base.ts in playwright.config.ts`.
145 +- [ ] **Step 7: Allow only Playwright configs to import root test infrastructure**
147 +Extend `isAllowedTestImport()` in `scripts/extensions.mjs` so resolved paths must remain under root `test/`, and importers must be either inside `__tests__` or named `playwright.config.ts`.
148 +Run `node scripts/test_extensions_static_check.mjs`.
149 +Expected: PASS.
151 +- [ ] **Step 8: Verify both projects are discovered**
147 163 - Both UI specs appear once under `[chromium]` and once under `[firefox]`.
148 164 - `real-rpc-smoke.spec.ts` remains listed but runtime-skipped unless explicitly enabled.
150 -- [ ] **Step 7: Install the two browser engines for verification**
166 +- [ ] **Step 9: Install the two browser engines for verification**
159 175 Existing cached engines may be reused.
160 176 Do not use `--with-deps`; system-package mutation belongs to CI environment setup, not this cross-platform task.
162 -- [ ] **Step 8: Run both suites directly**
178 +- [ ] **Step 10: Run both suites directly**
175 191 - UI’s real-RPC smoke is skipped by default in both projects.
176 192 - No OS-specific browser executable is required.
178 -- [ ] **Step 9: Commit browser matrix normalization**
194 +- [ ] **Step 11: Commit browser matrix normalization**
182 198 ```bash
183 -git add playwright.base.ts extensions/diff-review/playwright.config.ts extensions/ui/playwright.config.ts
199 +git add test/playwright.base.ts extensions/diff-review/playwright.config.ts extensions/ui/playwright.config.ts scripts/extensions.mjs scripts/test_extensions_static_check.mjs
184 200 git diff --cached --check
185 201 git commit -m "test(e2e): cover chromium and firefox"