Skip to content

test(playwright): local HAPI + testcontainers e2e setup#1990

Open
leoniedickson wants to merge 5 commits into
mainfrom
fix/playwright
Open

test(playwright): local HAPI + testcontainers e2e setup#1990
leoniedickson wants to merge 5 commits into
mainfrom
fix/playwright

Conversation

@leoniedickson

Copy link
Copy Markdown
Collaborator

Summary

  • Replaces the previous approach (which relied on an external EHR) with a self-contained local FHIR stack using testcontainers: HAPI FHIR + smart-launcher-v2 spin up in Docker before the test suite runs, seeded with the minimum Patient/Practitioner/Encounter resources needed for a SMART launch
  • Updates saving.spec.ts to use the dynamic local EHR URL, wait for the Form populated snackbar before interacting with the form (fixes WebKit flakiness where buildSourceResponse races with test interactions), and targets the correct item type for MBS715 v0.4.0-assembled (radio choice instead of boolean on the Consent tab)
  • Bumps the canonical version pin in globals.ts from 0.3.0-assembled to 0.4.0-assembled
  • Upgrades the Playwright CI job to Node 22 — required by testcontainers v12's bundled undici (webidl.util.markAsUncloneable is Node 22+ only)

Test plan

  • Playwright tests pass locally (npm run playwright -w apps/smart-forms-app)
  • Playwright CI job passes on this PR
  • All three browsers (chromium, firefox, webkit) pass the saving spec

🤖 Generated with Claude Code

leoniedickson and others added 5 commits June 30, 2026 14:16
… testcontainers

Replaces the live proxy.smartforms.io dependency with ephemeral Docker containers
(HAPI FHIR + aehrc/smart-launcher-v2) started in globalSetup, eliminating accumulated
test data on the remote server and making the suite self-contained and deterministic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ensures buildSourceResponse has completed before interacting with the
form, fixing a WebKit flakiness where the pre-population computation
races with user interactions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bump canonical version pin from 0.3.0 to 0.4.0-assembled and update
the Consent tab interaction from boolean to radio-button choice item,
which is how consent fields are rendered in the new questionnaire version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
testcontainers v12 bundles undici v8+ which calls
webidl.util.markAsUncloneable, an API only available in Node >= 22.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@leoniedickson leoniedickson requested a review from clinnygee July 1, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant