|
| 1 | +--- |
| 2 | +id: TASK-340.7 |
| 3 | +title: Playwright config and fixture tuning for speed |
| 4 | +status: In Progress |
| 5 | +assignee: [] |
| 6 | +created_date: '2026-04-30 19:29' |
| 7 | +updated_date: '2026-04-30 19:30' |
| 8 | +labels: |
| 9 | + - testing |
| 10 | + - e2e |
| 11 | + - performance |
| 12 | + - playwright |
| 13 | +dependencies: [] |
| 14 | +parent_task_id: TASK-340 |
| 15 | +priority: medium |
| 16 | +ordinal: 13500 |
| 17 | +--- |
| 18 | + |
| 19 | +## Description |
| 20 | + |
| 21 | +<!-- SECTION:DESCRIPTION:BEGIN --> |
| 22 | +Infrastructure changes to squeeze more performance out of the remaining Playwright tests. |
| 23 | + |
| 24 | +**Worker count** (`app/frontend/playwright.config.js:35`): |
| 25 | +- Change from `process.env.CI ? 4 : undefined` to `process.env.CI ? 6 : 12` |
| 26 | +- 12 local: uses more M4 Max cores (16 total, was only using 8) |
| 27 | +- 6 CI: safe bump on M-series runners, less dev-server contention than 8 |
| 28 | + |
| 29 | +**Dev server** (`app/frontend/playwright.config.js:122-129`): |
| 30 | +- Switch `webServer.command` from `npm run dev` (Vite HMR dev server) to a production build + preview |
| 31 | +- Eliminates per-request Vite transform cost under 8-12 concurrent workers |
| 32 | +- Verify correct preview port matches `baseURL`; check `package.json` scripts for `preview` target |
| 33 | + |
| 34 | +**Worker-scoped page fixture** (`app/frontend/tests/fixtures/helpers.js`): |
| 35 | +- Add a worker-scoped fixture that navigates once per worker and resets Alpine store state between tests via `page.evaluate` instead of full `page.goto('/')` |
| 36 | +- Migrate `library-search.spec.js` as proof-of-concept; if runtime improves, expand to other files |
| 37 | + |
| 38 | +Critical files: |
| 39 | +- `app/frontend/playwright.config.js:35,122-129` |
| 40 | +- `app/frontend/tests/fixtures/helpers.js` |
| 41 | +- `app/frontend/package.json` (check `preview` script) |
| 42 | +- `taskfiles/deno.yml:120-127` |
| 43 | +<!-- SECTION:DESCRIPTION:END --> |
| 44 | + |
| 45 | +## Acceptance Criteria |
| 46 | +<!-- AC:BEGIN --> |
| 47 | +- [ ] #1 Workers set to 12 local / 6 CI in playwright.config.js |
| 48 | +- [ ] #2 webServer uses production preview build |
| 49 | +- [ ] #3 Worker-scoped fixture implemented and tested on library-search.spec.js |
| 50 | +- [ ] #4 task test:e2e green with measurably lower runtime |
| 51 | +<!-- AC:END --> |
0 commit comments