#playwright email testing#automated signup testing#disposable email api#end to end testing otp#qa email verification

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.

•4 min read•By Email Generator
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:

  1. Inbox Provisioning: The test suite queries the Email Generator API to generate a unique mailbox address with clean MX records.
  2. User Registration: Playwright navigates to your application's signup form and submits the programmatic email.
  3. 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

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.

Automating Signup Flow Tests with Playwright & Disposab...