Free Temporary Email for E2E Testing with @tempyemail/e2e-testing
Official npm package for automated email testing. Zero config, works with Playwright, Cypress, Jest, and Vitest. Extract OTP codes and verification links automatically.
@tempyemail/e2e-testing is the official JavaScript/TypeScript client for tempy.email, built for one job: making email assertions in automated tests as ordinary as clicking a button. The pattern it replaces is familiar and painful — a shared Gmail test account with IMAP polling, flaky regexes, and tests that collide when two CI jobs run at once. With the package, each test creates its own mailbox programmatically, so parallel runs never share state, and helpers like OTP extraction (6-digit, alphanumeric, and UUID formats) and verification-link extraction handle the parsing you'd otherwise reinvent per project.
Under the hood it polls with exponential backoff rather than fixed sleeps, which keeps tests fast when email arrives quickly (usually within a couple of seconds) and patient when it doesn't. It ships TypeScript definitions, works in Playwright, Cypress, Jest, and Vitest without adapters, and supports webhooks when you'd rather push than poll. The typical spec reads linearly: create a mailbox, drive your signup form with the generated address, await the OTP or magic link, assert, done. Because mailboxes are created through the tempy.email developer API, you'll want an API key from the developer portal for programmatic use.
Generate Your Free Temporary Email
Ready in seconds. No signup required. Use it with E2E Testing with @tempyemail/e2e-testing right away.
Why Use Temporary Email for E2E Testing with @tempyemail/e2e-testing?
How to Use Temporary Email with E2E Testing with @tempyemail/e2e-testing
- 1
Generate a temporary email address
Click the button above to instantly create a free disposable email address.
- 2
Copy and use it with E2E Testing with @tempyemail/e2e-testing
Use your temporary email during E2E Testing with @tempyemail/e2e-testing signup or wherever an email is required.
- 3
Receive emails instantly
All emails appear in your temporary inbox in real-time. Verification codes, confirmations, everything.
- 4
Let it expire automatically
After 10 minutes (or longer if extended), your address expires and all data is permanently deleted.
Common Use Cases for E2E Testing with @tempyemail/e2e-testing
- Automated signup flow testing with email verification
- Testing password reset with magic links or OTP codes
- 2FA email authentication testing
- Testing transactional email delivery in CI/CD pipelines
- End-to-end testing of email-triggered workflows
- Parallel test execution with unique mailboxes
- Integration testing for email-dependent features
- Testing email templates and content
- Automated extraction of verification codes
- Testing email-based notifications
Frequently Asked Questions
How does the package extract OTP codes from emails?
Built-in extractors recognize common one-time-code formats — 6-digit numeric, alphanumeric, and UUID-style tokens — and pull them from incoming messages so your test gets the code as a string, no hand-rolled regex needed. Verification links are extracted the same way.
Can I run tests in parallel without emails crossing over?
Yes — that's the core design. Each test (or worker) creates its own unique mailbox, so there's no shared inbox to race over. Parallel Playwright shards and concurrent CI jobs each see only their own messages.
Do I need an API key to use @tempyemail/e2e-testing?
Programmatic mailbox creation goes through the tempy.email developer API, which uses API keys — sign in at the developer portal (tempy.email/developers) to get one. The package itself needs no other configuration.
How long do test mailboxes wait for an email?
The wait helpers poll with exponential backoff up to a configurable timeout, so a fast email resolves in seconds while slow SMTP paths get a sensible grace period instead of a hard-coded sleep.
Ready to Use Temporary Email with E2E Testing with @tempyemail/e2e-testing?
Generate your free temporary email address now. No signup, no personal information required.
Get Started Free