Send with Resend. Catch with ZeroDrop.
Testing Resend email flows with Playwright — email verification, magic links, OTP, password reset. No regex, no shared inboxes, no Docker.
git clone https://github.com/zerodrop-dev/resend-playwright-zerodrop
cd resend-playwright-zerodrop
npm install
cp .env.example .env # add RESEND_API_KEY
npx playwright install chromium
npm test| Test file | Email flow | ZeroDrop field |
|---|---|---|
email-verification.spec.ts |
Signup verification | email.magicLink |
magic-link.spec.ts |
Passwordless login | email.magicLink |
otp.spec.ts |
OTP sign-in | email.otp |
password-reset.spec.ts |
Password reset | email.magicLink |
Each test file includes:
- A full E2E test against your app
- A direct Resend → ZeroDrop test (no app needed)
import { Resend } from "resend";
import { ZeroDrop } from "zerodrop-client";
const resend = new Resend(process.env.RESEND_API_KEY);
const mail = new ZeroDrop();
test("email verification", async ({ page }) => {
const inbox = mail.generateInbox(); // instant, no network request
// Resend sends the email
await resend.emails.send({
from: "Auth <onboarding@resend.dev>",
to: inbox,
subject: "Verify your email",
text: "Click to verify: https://yourapp.com/verify?token=abc123",
});
// ZeroDrop catches it at Cloudflare's edge
const email = await mail.waitForLatest(inbox, { timeout: 15000 });
email.otp // "847291" — auto-extracted, no regex
email.magicLink // "https://yourapp.com/verify?token=abc123" — auto-extracted
});| Tool | Purpose |
|---|---|
| Resend | Email sending |
| ZeroDrop | Email catching + OTP/magic link extraction |
| Playwright | E2E testing |
1. Clone and install
git clone https://github.com/zerodrop-dev/resend-playwright-zerodrop
cd resend-playwright-zerodrop
npm install
npx playwright install chromium2. Configure environment
cp .env.example .envAdd your RESEND_API_KEY from resend.com.
ZeroDrop needs no API key — free, no signup.
3. Run tests
npm test- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npx playwright install --with-deps chromium
- run: npm test
env:
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
APP_URL: https://your-staging-url.comNo Docker. No SMTP. ZeroDrop works out of the box in CI.
Resend handles the sending side perfectly. The catching side — reading verification emails in tests — is the unsolved gap.
| Approach | Problem |
|---|---|
| Mock the email | Tests pass while broken emails ship |
| Shared Gmail inbox | Race conditions in parallel test runs |
| MailHog | Requires Docker, doesn't test real Resend delivery |
ZeroDrop gives each test a real isolated inbox. Emails sent via Resend land in under 1 second. OTPs and magic links are extracted at Cloudflare's edge — your test just reads email.otp or email.magicLink.
Free, no signup → zerodrop.dev