Skip to content

E2E Triage

Step 1: Run tests and capture failures

bash
cd frontend && npx playwright test --reporter=list 2>&1 | tail -80

Step 2: For each failing test, investigate

  • Read the failing spec file in frontend/e2e/
  • Check frontend/e2e/fixtures.ts — shared setup broken here affects many tests
  • Check frontend/playwright.config.ts for baseURL, timeout, and worker config

Step 3: Identify failure pattern

SymptomLikely CauseFix
locator.waitFor timeoutSelector changed or element missingUpdate selector, check component render
toBeDisabled / toBeEnabled raceAsync state not awaitedUse waitForResponse or waitForSelector
ECONNREFUSEDDev server not running or proxy misconfiguredCheck vite.config.ts proxy, use waitForResponse
Snapshot diffVisual change since last baselineRun npx playwright test --update-snapshots if intentional
net::ERR_ABORTEDBackend not running or wrong endpoint URLVerify endpoint URL matches backend routes in backend/app/api/v1/

Step 4: Fix principles

  • Prefer waitForResponse over toBeDisabled for button states after API calls
  • Prefer page.getByRole / page.getByTestId over CSS selectors
  • Avoid fixed page.waitForTimeout() — use explicit conditions
  • For confirm endpoint URLs: verify against backend/app/api/v1/ route definitions
  • Check frontend/e2e/fixtures.ts authenticatedPage fixture before touching auth flows

Step 5: Verify fix

bash
cd frontend && npx playwright test <spec-file> --reporter=list

Read-only documentation bundle of the Med Tracker agent stack. AU compliance baked in (AHPRA + Privacy Act 1988 + Spam Act 2003).