Test framework
How the Playwright test suite is structured, run, and aggregated.
xcity-home ships with a multi-tier Playwright suite. Every PR runs smoke + e2e; the nightly job runs everything including a11y and visual regression, then writes the test dashboard.
Suite layout
tests/
├── smoke/ every route loads with 200 + a key DOM marker
├── e2e/ flows: auth, blog filter, share buttons, dashboard, pricing
├── api/ contract tests for /api/* endpoints (status + shape)
├── a11y/ axe scan on the top 10 pages
├── visual/ per-section snapshots (nightly only)
└── fixtures/ reusable mocks (Stripe, Supabase, LiteLLM)
Local commands
npm run test # all suites except visual
npm run test:smoke # < 30 seconds — route load + 200
npm run test:e2e # full user flows
npm run test:api # API contract tests
npm run test:a11y # axe-core scan
npm run test:visual # snapshot suite (use --update-snapshots after intentional UI changes)
npm run test:dashboard # aggregate recent runs → docs/test-dashboard
Picking the right suite
| Change | Run |
|---|---|
| Markdown / blog content | test:smoke |
| Component refactor | test:smoke + test:e2e |
| New API endpoint | test:api + add a smoke for it |
| Visual change | test:visual --update-snapshots after review |
| Pre-merge full sweep | npm test |
What CI runs
- Pull request:
test:smoke+test:e2e+test:api— blocks merge on failure. - Nightly main: all suites +
test:visual+ dashboard publish.
See .github/workflows/test.yml for the full pipeline.
Last updated: