Skip to main content
The hosted TempInbox service has no supported public automation API. These implementation examples are for an instance you operate and must be checked against its deployed version, authentication, inbound mail routing, and rate limits. Do not export hosted browser access tokens for CI. For hosted manual use, see QA workflows.

Why use a real inbox in E2E tests?

Test fixtures and mocked emails skip the actual SMTP delivery path — meaning they miss:
  • Rendering bugs in email templates
  • Spam filter rejections
  • SMTP misconfiguration
  • Delays caused by delivery queuing
TempInbox tests the real path. Each test run gets a unique address so parallel runs never collide.

Setup

No package install needed — the TempInbox API is a plain HTTP REST API.

Helper: tempmail.ts

Create a shared helper that manages address creation and polling:
tempmail.ts

Example: OTP verification flow

tests/otp-signup.spec.ts

tests/magic-link.spec.ts

Parallel test safety

Each test creates its own unique address — no shared state, no race conditions.
playwright.config.ts

Tips

30 seconds is usually enough for local/staging environments. For external SMTP in CI, use 60 seconds.
2–3 second intervals avoid rate limiting. The TempInbox API caches mail lists for 60 seconds at offset=0.
Call DELETE /api/delete_address in afterAll to keep inboxes tidy, and follow that deployment’s retention policy; address and message lifetime are not guaranteed.