E2E Testing with Real Emails
Stop mocking emails. Test the real flow—from trigger to inbox—with deterministic, API-driven email verification.
E2E email tests are notoriously flaky
- Setting up mail servers for tests is complex and brittle
- Timing issues cause intermittent failures
- Shared inboxes create race conditions between parallel tests
- Mocking skips the actual email delivery path
Deterministic email testing with plop
- Generate unique mailbox+tag addresses per test run
- Fetch emails via REST API with polling or webhooks
- Assert on subject, body, headers, and attachments
- Isolated inboxes eliminate cross-test interference
Example
Playwright E2E Test Exampletypescript
import { test, expect } from '@playwright/test';
test('user receives welcome email after signup', async ({ page }) => {
const testEmail = `signup+${Date.now()}@in.plop.email`;
// Trigger the signup flow
await page.goto('/signup');
await page.fill('[name="email"]', testEmail);
await page.click('button[type="submit"]');
// Fetch the welcome email via plop API
const response = await fetch(
`https://api.plop.email/v1/messages/latest?to=${testEmail}`,
{ headers: { Authorization: `Bearer ${process.env.PLOP_API_KEY}` } }
);
const email = await response.json();
// Assert email content
expect(email.subject).toContain('Welcome');
expect(email.htmlContent).toContain('Get started');
});Benefits
Zero Infrastructure
No SMTP servers to maintain. Just API calls to fetch emails.
Parallel-Safe
Unique addresses per test eliminate race conditions entirely.
CI/CD Ready
Works in any environment—local, Docker, or cloud CI runners.
Real Email Path
Test actual delivery, not mocked responses.
Related Use Cases
Related Integrations
Ready to test e2e testing?
Get started with plop.email in minutes. No credit card required.