mirror of
https://github.com/tompro/sattle.git
synced 2026-08-26 23:05:58 +00:00
1.8 KiB
1.8 KiB
e2e — Playwright suite
Browser-level tests against the real app. Run: npm run test:e2e
(test:e2e:ui for the UI mode).
ENVIRONMENT
- System Chromium, never downloaded browsers:
CHROMIUM_PATHenv orcommand -v chromiumfallback (flake dev shell provides both). CI installs Playwright's own chromium — the config only forcesexecutablePathwhen a system browser exists. webServerbootsquasar dev -m spa --port 9333(~15-25s ready),reuseExistingServerlocally. serviceWorkers blocked.
STRUCTURE
fixtures.ts— extended test with themintfixture (MintMocker), routes unrouted after each test.helpers/MintMocker.ts—page.routemocks on never-resolvinghttps://mint.test/https://mint2.testorigins. Responses must carryAccess-Control-Allow-Origin: *. IMPORTANT: mirror the real protocol —mintPubkeyis announced on the mint-address (/.well-known/lnurlw/) and note-info responses, NOT the payRequest (a too-generous mock once masked a real bug).helpers/wallet.ts—createFreshWallet(page): drives onboarding UI to an unlocked 0-sat wallet.
CONVENTIONS
- No real network, ever — every external call goes through a route mock.
- First-contact trust prompt: receiving a note with a
mintPubkeyopens the "New mint" dialog — specs must click through it. - Toasts duplicate in-page text — scope assertions to
.q-pageor the dialog, never the raw text. - Dev-only test hooks (e.g.
window.__sattleNwcTest) exist for injecting fake transports; never available in production builds. - WebAuthn ceremonies are NOT e2e-testable headless — assert the honest unsupported state instead.
- Known lint drift:
import()type annotations tripconsistent-type-imports(pre-existing; the dev checker only lints app code, so CI/e2e are unaffected).