Troubleshooting & Tips
Even with solid helpers, complex flows can fail for mundane reasons. Use this page as a checklist when debugging CI runs or local flakes.
Common issues
Environment
`.env.playwright` not found
Ensure the file lives inside dapp/.env.playwright. env.ts logs [e2e env] .env.playwright not found when both search paths fail.
Private key format errors
Run npx tsx dapp/e2e/playwright/debug-key.ts to see where normalization fails (invisible chars, stray quotes, incorrect length).
CHAIN_ID undefined
If you set NETWORK=Ritonet, CHAIN_ID becomes mandatory. env.ts throws with [e2e env] CHAIN_ID is required....
Debugging tips
- Enable debug flags — Most helpers accept
debug: true(e.g.installPortfolioAlchemyMock). Verbose logs are invaluable on CI. - Capture screenshots —
ScreenshotUtils.capture('gate-error')stores before/after screenshots undertest-results/screenshots. - Console filtering —
setupTestpipes wallet-related console logs to the terminal. Add your ownpage.on('console')listeners for component-specific debugging. - Use
test.step— Wrapping flows intest.step('Gate unlock', async () => { ... })produces readable trace chunks in Playwright HTML reports. - Surface retries in logs — Helpers already log attempt counts. If you add new retries, follow the
[Component] Attempt x/yformat to stay consistent.
Never mask genuine backend failures with mocks. The existing mocks only bypass unreliable external data (AI + portfolio). Everything else should keep talking to the staging API so we notice regressions.
Still stuck? Cross-reference the spec playbook for the relevant test or inspect the Playwright trace (npx playwright show-trace trace.zip) to see DOM timing issues.