Skip to Content
Welcome to RitoSwap's documentation!
dAppPlaywrightTroubleshooting & Tips

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

`.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 screenshotsScreenshotUtils.capture('gate-error') stores before/after screenshots under test-results/screenshots.
  • Console filteringsetupTest pipes wallet-related console logs to the terminal. Add your own page.on('console') listeners for component-specific debugging.
  • Use test.step — Wrapping flows in test.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/y format 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.

Last updated on

RitoSwap Docs does not store, collect or access any of your conversations. All saved prompts are stored locally in your browser only.