pediatric-ai-scribe-v3/e2e/tests
Daniel 05dcd1146d test(e2e): repair the harness, taking the browser suite from 96 failures to 11
Three separate reasons tests were failing, none of them a defect in the app.

The calculators. e2e-harness.html loaded calculators.js and drugs-loader.js with
`defer` after they were split into ES modules; index.html was updated at the
time and this page was not. A module parsed as a classic script throws "Cannot
use import statement outside a module" before a line runs, so no click handler
was ever attached: the pills rendered from static HTML and did nothing. Only the
first calculator appeared to pass, because it carries `active` in the markup and
needs no click. That was 52 failures.

Settings and FAQ. Both moved from the tab rail into the account-card menu; the
helper still clicked button.tab-btn[data-tab=…] and timed out. Ten more.

The AI mocks, which had stopped intercepting for two independent reasons and so
were calling the real model on every run — spending credits and comparing
genuine output against strings like "MOCK HPI from dictation". A '**/api/x' glob
matches no URL on Playwright 1.50, and page.route fails silently when nothing
matches; measured against a real URL, that glob and '*/**/api/x' both matched
zero times where a regex matched. Fixing that alone was not enough: the app
registers a service worker that answers every /api/ request with its own
fetch(), and a request made inside a service worker never reaches page.route.
Blocking registration in the config puts them back in the page. The mocked
dictation test now finishes in 1.6s rather than 7.5s, which is what a real model
call costs.

Whole suite: 204 passed / 96 failed in 15.8 minutes, now 289 passed / 11 failed
in 6.8. The remaining eleven are spread across nine specs with no shared cause
and are not touched here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
2026-09-11 18:54:03 +02:00
..
admin-search-sources.spec.js test(e2e): seed an admin account, and fix the sign-in that broke the browser suite 2026-09-11 17:24:32 +02:00
ai-endpoints-contract.spec.js
auth-gated-smoke.spec.js
auth-screen.spec.js improve learning hub generation flow 2026-05-08 09:32:58 +02:00
bedside-smoke.spec.js
chart-review-workflow.spec.js
encounter-save-load.spec.js
encounter-workflow.spec.js
extensions-crud.spec.js
hospitalcourse-workflow.spec.js test(e2e): +44 tests — sick visit, hospital course, auth screen, 2026-04-23 18:58:38 +02:00
learning-tab.spec.js
model-selector.spec.js test(e2e): +44 tests — sick visit, hospital course, auth screen, 2026-04-23 18:58:38 +02:00
pe-guide-smoke.spec.js
session-persistence.spec.js Fix Turnstile in the mobile app; drop it from login 2026-07-30 17:22:03 +02:00
settings-faq-dictation.spec.js test(e2e): repair the harness, taking the browser suite from 96 failures to 11 2026-09-11 18:54:03 +02:00
sickvisit-workflow.spec.js test(e2e): +44 tests — sick visit, hospital course, auth screen, 2026-04-23 18:58:38 +02:00
soap-hospital-workflow.spec.js
top-calculators.spec.js
ui-state-persistence.spec.js
vaxschedule-content.spec.js
wellvisit-workflow.spec.js test(e2e): +44 tests — sick visit, hospital course, auth screen, 2026-04-23 18:58:38 +02:00