Cypress Email Testing Guide 2026

How to test email flows in Cypress with disposable inboxes. Complete guide: email verification, OTP codes, magic links, password reset, parallel tests. No Mailhog, no SMTP. Free code examples.

Frequently Asked Questions

How do I test email in Cypress without a real mail server?

sed.sh gives you real email addresses that receive actual emails, accessible via REST API. There is no SMTP server, no Mailhog, no Docker container to run. Install @sed-sh/sdk, create an inbox with POST /inboxes, and poll GET /inboxes/{code}/messages until your email arrives.

How do I do Cypress email testing without Mailhog?

sed.sh is the simplest drop-in for Mailhog in Cypress. No infrastructure to maintain — just a REST API call. Your CI pipeline stays clean because there is nothing to spin up alongside your app.

How do I wait for an email to arrive in my Cypress test?

Use a while-loop polling GET /inboxes/{code}/messages every 2 seconds with a 30-second overall timeout. Return as soon as messages.length > 0. Never use cy.wait() with a fixed delay — it is slow and brittle.

Can I run Cypress email tests in parallel?

Yes. Create one inbox per test in beforeEach, delete it in afterEach. Each inbox has a unique code so parallel workers cannot interfere with each other. Works with Cypress Cloud, GitHub Actions matrix, and cypress-parallel.

How do I extract a 6-digit OTP from an email body in Cypress?

Fetch the full message with GET /inboxes/{code}/messages/{id}, then apply the regex /\b(\d{6})\b/ to fullEmail.body. The sed.sh API always returns a plain-text body field, so you do not need to strip HTML tags.

Does sed.sh work with Cypress Component Testing?

sed.sh is a REST API your test code calls directly — it is framework-agnostic. Cypress Component Tests run in a browser context and can call the sed.sh API the same way as E2E tests, as long as CORS is handled (the API supports it).

How much does it cost to run 1,000 Cypress email tests?

$1.20 — 1,000 emails × $0.0012. The $10 minimum deposit covers ~8,300 tests at tier A pricing. No subscription, no recurring charges.