E2E email verification testing with Playwright and ZeroDrop
No Docker. No SMTP. No MailHog. Just npm install and a real inbox.
Testing auth flows that send emails (verification links, password resets, magic links) is painful. Most teams either:
- Mock the email sending layer (doesn't test real delivery)
- Run MailHog in Docker (adds CI overhead and maintenance)
- Skip the test entirely
This repo shows a third option: catch real emails in CI using ZeroDrop — a disposable inbox that works over HTTP with no infrastructure.
# .github/workflows/ci.yml
- name: Generate ZeroDrop test inbox
id: inbox
uses: zerodrop-dev/create-inbox@v1
- name: Run Playwright tests
run: npx playwright test
env:
TEST_INBOX: ${{ steps.inbox.outputs.inbox }}// tests/auth.spec.ts
import { ZeroDrop } from 'zerodrop-client';
const mail = new ZeroDrop();
const inbox = process.env.TEST_INBOX ?? mail.generateInbox();
// Sign up with the disposable inbox
await page.fill('[data-testid="email"]', inbox);
await page.click('[data-testid="submit"]');
// Wait for the real verification email
const email = await mail.waitForLatest(inbox, { timeout: 15000 });
const link = email.body.match(/https?:\/\/\S+verify\S+/)?.[0];
// Click it
await page.goto(link);No mocking. No Docker container. The email arrives in under 3 seconds.
npm install
npx playwright install chromium
npm run devIn a second terminal:
npx playwright testA fresh inbox is generated automatically when TEST_INBOX is not set.
- Next.js — demo app
- Playwright — E2E tests
- zerodrop-client — disposable inbox SDK
- zerodrop-dev/create-inbox — GitHub Action
ZeroDrop's free tier uses a shared domain (zerodrop-sandbox.online) with AI spam filtering and 30-minute TTL. No signup required.
For custom domains, team seats, and API keys: zerodrop.dev