Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 2.92 KB

testing.md

File metadata and controls

11 lines (6 loc) · 2.92 KB

Test guide

Use pnpm verify for the complete gate: lint, typecheck (including WXT generated types), unit, components, production build, loaded-extension E2E and visual cases. Subsets: pnpm test:unit, pnpm test:components, pnpm test:extension and pnpm test:visual. Install the pinned Playwright Chromium first; cloud uses PLAYWRIGHT_BROWSERS_PATH=/workspace/.cache/ms-playwright. Vite fixture server starts automatically on 127.0.0.1:4173; no external site is needed. Python 3 standard library decodes screenshot pixels for numeric color checks.

Unit tests cover strict schemas/redaction, IDs/URL/shadow resolution, cancellation/failure/retry, lifecycle rollback/cleanup races and numeric boundaries. Components exercise actual React controls and hostile strings. Browser tests load the built extension into a persistent Chromium profile; they exercise real worker injection/messages, singleton/control cleanup, audits/fixed pairs, targets/focus/shadows, baseline previews, actual downloads and repeated cycles. Production tests use native browser-level Extensions.triggerAction with the explicit test-browser flag to grant activeTab; manifest/test-hook checks verify the shipped build independently. Never substitute a mocked web app for these gates.

Fixtures cover broken/fixed labels/names/images/contrast, boundary sizes, hidden/disabled/known-good controls, transformed targets, open/nested shadows, excluded frames, radio/positive-tabindex/native modal and opt-in broken/fixed Tab loop with safe Escape, SPA insertion, canvas, existing filters and 10,000-control scope. Audit expectation is known rule IDs/fixed-pair removal, not a fragile total engine count. Resource counts include internal ownership markers and return to baseline over 20 module cycles. Five activation samples save hardware/browser/raw timings; median ≤500 ms, worst ≤1500 ms are environment-specific targets. Native Stop/Start and changed Chrome background context identity prove worker restart; Playwright target-handle events alone do not.

Artifacts: artifacts/extension and artifacts/visual keep separate test captures, artifacts/production-action.png and activation-performance.json capture production/timing evidence. Failure traces/screenshots and playwright-report are ignored. Only synthetic fixture content is permitted. Agent image inspection is distinct from a human accessibility walkthrough. Record test counts, exit status, hardware/method and pending human gates in task evidence; zero tests, skipped tests or generated CI config are not passes.

Use docs/module-author.md and templates/ for a small-module rehearsal. CI runs frozen install/advisory checks, official browser/library installation, full verify and production package; artifacts retain synthetic failures three days and release/timing artifacts seven. Read actual run/check conclusions, never fabricate success. Contributor changes to shared contracts/lifecycle need the full suite and production permission/artifact checks.