Commit bce0a01
authored
phase a/fix playwright webserver (#48)
* fix(e2e): wire playwright webServer to boot live code-iq backend
Adds a webServer block to src/main/frontend/playwright.config.ts so
npm run test:e2e boots a real code-iq serve against the
spring-petclinic fixture before any spec runs, removing the root cause
of the 0-pass / 575-fail Playwright audit result.
Design choices:
- /api/stats is the readiness probe, not /actuator/health (today
returns 503 OUT_OF_SERVICE; tracked separately on
phase-a/fix-graph-health).
- bash -c "exec java ..." so Playwright can signal the JVM cleanly on
teardown, and so the *-cli.jar glob expands.
- Overridable via BASE_URL (skip webServer entirely), E2E_FIXTURE (pick
a different pre-enriched repo), E2E_PORT (avoid port conflicts).
- baseURL unchanged for spec code — still http://localhost:8080 by
default, overridable via BASE_URL.
Verified on this machine:
- webServer boots the backend; /api/stats returns 200 within 120s.
- Playwright connects to the backend.
Remaining system-level blocker (not a config issue):
chromium headless shell is missing 8 shared libraries on this host
(libatk-1.0, libXcomposite, libgbm, libatspi, ...). Fix once per host:
sudo npx playwright install-deps chromium
Once that's run, npm run test:e2e exercises the full 131-test
chromium suite against a real backend. The original baseline
0p/575f number was the sum across 7 Playwright projects.
Documented in BASELINE.md.
* docs(baseline): capture real Playwright chromium pass rate (33/131)
With the webServer wiring in place + system deps installed via
`sudo npx playwright install-deps chromium`, ran the full chromium
project (19.2 min wall time). Results:
33 passed / 94 failed / 4 skipped
Huge jump from the "0 passed / 575 failed" baseline — the 575 was the
sum across 7 Playwright projects (4 browsers × many responsive
breakpoints), and all of it was caused by not having a backend. With
a live backend against the spring-petclinic fixture, a third of the
chromium suite passes.
The remaining 94 failures are NOT environmental; they're genuine test
↔ UI divergence:
- expect(locator).toBeVisible / element(s) not found — selectors
targeting UI elements that don't render in the current build
(component/CSS-class renames).
- strict mode violations on `getByText(/0/)` — tests assume unique
stat values; spring-petclinic's 691-node graph produces many
zero-valued cards, so the match resolves to 8+ elements.
- toHaveLength mismatches — expected N list items, got different count.
- "Button has no aria-label" in accessibility.spec.ts — real a11y
regressions, not a test bug.
- 30s timeouts on locator.focus / locator.boundingBox — elements
that never appear.
Treating the chromium 33/94/4 split as the honest Phase A baseline.
Test-suite maintenance (update selectors to match current UI, or
generate a deterministic fixture) is scoped out of Phase A.1 parent a131a80 commit bce0a01
2 files changed
Lines changed: 44 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
225 | 238 | | |
226 | 239 | | |
227 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
25 | 53 | | |
26 | | - | |
| 54 | + | |
27 | 55 | | |
28 | 56 | | |
29 | 57 | | |
| |||
0 commit comments