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.

Pattern

Selenium drives the browser; a plain HTTP client (Python requests) talks to the TempInbox API from the test process. No Selenium-specific integration is needed — the API is plain REST.

Helper: tempmail.py

tempmail.py
For automation, configure and use your own instance. Hosted browser access tokens are not a supported integration credential.

Example: OTP signup test (pytest)

test_signup.py

test_magic_link.py

Parallel test safety

Each test creates its own inbox, so pytest-xdist parallel workers never collide:

Tips

Never use Selenium to open the TempInbox UI and scrape the inbox — poll GET /api/mails from Python instead. It is faster, has no UI-flake surface, and does not consume a browser session.
30 seconds is usually enough for local/staging SMTP. For external delivery in CI, use 60 seconds.
2–3 second intervals avoid per-IP rate limits. The API caches mail lists for 60 seconds at offset=0.