For the complete documentation index, see llms-docs.txt or the site index llms.txt. Full docs corpus: llms-full-docs.txt. Prefer the markdown version of this page at /docs/guides/e2e-testing-playwright.md. Product capabilities: skill.md. Docs MCP: /docs/mcp. Site MCP: /mcp.

E2E Testing with Playwright

How to test email sending end-to-end with Playwright and Reloop.

Test your email flows end-to-end using Playwright and Reloop's API.

Approach

Use Reloop's API to verify that emails were sent correctly during your E2E tests. Instead of checking actual inboxes, query the Reloop API to confirm emails were delivered.

Setup

npm install @playwright/test reloop

Example Test

import { test, expect } from '@playwright/test';
import { Reloop } from 'reloop';

const reloop = new Reloop(process.env.RELOOP_API_KEY);

test('signup sends welcome email', async ({ page }) => {
  // Trigger the signup flow
  await page.goto('/signup');
  await page.fill('[name="email"]', 'test@example.com');
  await page.click('button[type="submit"]');

  // Wait for the email to be sent
  await page.waitForTimeout(3000);

  // Verify via Reloop API
  const { data } = await reloop.emails.list();
  const welcomeEmail = data?.data?.find(
    (e) => e.to?.includes('test@example.com') && e.subject?.includes('Welcome')
  );

  expect(welcomeEmail).toBeDefined();
  expect(welcomeEmail?.last_event).toBe('delivered');
});

Use testing email addresses to avoid sending real emails during tests.

Was this page helpful?

Edit this page