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 (Pythonrequests) 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
Example: magic link flow
test_magic_link.py
Parallel test safety
Each test creates its own inbox, sopytest-xdist parallel workers never collide:
Tips
Poll the API, not the browser
Poll the API, not the browser
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.Set a realistic poll timeout
Set a realistic poll timeout
30 seconds is usually enough for local/staging SMTP. For external delivery in CI, use 60 seconds.
Don't poll too fast
Don't poll too fast
2–3 second intervals avoid per-IP rate limits. The API caches mail lists for 60 seconds at offset=0.
Related reading
- Email for Testing: A Practical QA Playbook — when to use real inboxes vs mocks
- QA Workflows guide — the same patterns, framework-agnostic
- Playwright guide and Cypress guide — JS/TS equivalents