Automating Signup Flow Tests with Playwright & Disposable Email API
Learn how software QA engineers automate end-to-end user registration and OTP email verification testing using Playwright, Node.js, and disposable email APIs.
Table of Contents (4 Sections)▼
End-to-end (E2E) registration testing is one of the most failure-prone areas of web applications. Mocking SMTP servers often hides real deliverability regressions, while testing against hardcoded Gmail accounts quickly triggers rate limits and CAPTCHAs.
Using a real-time disposable email API allows QA teams to provision programmatic inboxes, trigger live user signups, and poll for verification links inside continuous integration (CI) pipelines.
Architectural Architecture for CI/CD Email Testing
Automating real email flows involves three key stages:
- Inbox Provisioning: The test suite queries the Email Generator API to generate a unique mailbox address with clean MX records.
- User Registration: Playwright navigates to your application's signup form and submits the programmatic email.
- Polling & Assertion: The test script queries the inbox JSON endpoint for the arrival of the OTP token or verification link, clicks it, and verifies successful onboarding.
Playwright Code Example (TypeScript)
import { test, expect } from '@playwright/test';test('User registration with instant disposable email verification', async ({ page }) => {
const randomUser = probe-runner-${Date.now()};
const testEmail = ${randomUser}@vapestore.eu.cc;
// 1. Submit application signup form await page.goto('https://staging.example.com/signup'); await page.fill('input[name="email"]', testEmail); await page.fill('input[name="password"]', 'TestPass123!Secure'); await page.click('button[type="submit"]');
// 2. Poll the Email Generator Public API for the verification email
const apiUrl = https://generatoremail.com/api/public/inbox?email=${encodeURIComponent(testEmail)};
let otpCode: string | null = null;
for (let attempt = 0; attempt < 10; attempt++) { await page.waitForTimeout(2000); const response = await fetch(apiUrl); const messages = await response.json(); if (Array.isArray(messages) && messages.length > 0) { const match = messages[0].body.match(/\b(\d{6})\b/); if (match) { otpCode = match[1]; break; } } }
expect(otpCode).toBeTruthy();
// 3. Enter OTP into verification input await page.fill('input[name="otp"]', otpCode!); await page.click('button#verify-btn'); await expect(page.locator('.dashboard-welcome')).toBeVisible(); }); ```
Best Practices for CI/CD Email Tests
- Rotate Test Domains: Cycle across different domains from our pool to ensure your application doesn't accidentally hardcode domain restrictions.
- Set Realistic Polling Backoffs: Poll every 1.5 to 2 seconds for a maximum of 20 seconds.
- Sanitize Sensitive Tokens: Ensure test logs redact session tokens and passwords.
Frequently Asked Questions
Does Email Generator require API keys for public QA inbox polling? No API key is required to query messages for public testing mailboxes via the public endpoint. For high-volume dedicated staging setups, check our Developers API guide.
Can I test HTML email rendering in Playwright? Yes, the API returns full sanitized HTML body and plain text versions of incoming messages, enabling visual comparison or DOM selector assertions.
Related Guides
How to Receive Discord Verification Codes with Temporary Email (2026)
Step-by-step guide to verifying Discord accounts, bots, and community server invites using disposable temporary email addresses without exposing your personal inbox.
Gmail Dot & Plus Addressing Guide: How Gmail Aliases Work
Learn how Gmail's built-in dot (.) and plus (+tag) addressing rules create unlimited variations of your existing Gmail address—and where aliases fall short of true disposable email.
How to Connect Your Own Custom Domain to Email Generator
Step-by-step instructions for pointing your own domain's DNS MX record to Email Generator and submitting it for platform approval—without ever sharing registrar passwords.
Try Email Generator Free
Generate a temporary email address instantly and receive incoming verification emails through an easy-to-use online inbox. No sign-up required.
