# How to test signup flows with Playwright and real email verification

Sign up with a fresh Humanless address in every test run, so the account is new each time and the confirmation email really goes out through your email provider. Create the inbox with `createIdentity({ channels: ["email"] })`, submit the signup form, then call `waitForCode` if your app sends a code or `waitForLink` if it sends a confirmation link, and finish the flow in the same browser page. `withIdentity` deletes the inbox afterwards, even when the test fails. Because the email travels through your real sending path, the test also catches broken templates, a wrong sender domain or a staging environment that silently stops sending.

```ts signup.spec.ts
await withIdentity(hl, { channels: ["email"] }, async ({ identity_id, email }) => {
  await page.goto("/signup");
  await page.getByLabel("Email").fill(email!);
  await page.getByLabel("Password").fill("correct-horse-battery");
  const since = Date.now();
  await page.getByRole("button", { name: "Create account" }).click();
  const { url } = await hl.waitForLink({ identityId: identity_id, since, timeout: 25 });
  await page.goto(url);
  await expect(page.getByText("Email confirmed")).toBeVisible();
});
```

## Other options

- **Mailpit** for local and CI runs: real SMTP output from your app, but not your production email provider.
- **Gmail or Google Workspace with plus-addressing** and the Gmail API, if you can't add a service.
- **Skip verification in test data** (mark the user verified in your seed script) for tests that aren't about signup, and keep one real end-to-end signup test.

> **Use policy:** Only for apps you own or are authorized to test. Never use this to create accounts on third-party services. See the [Terms](/terms).

More: [How to test email OTP and verification codes in Playwright](/guides/playwright-email-otp) · [All answers](/answers/)

Last updated 2026-12-04

Canonical: https://usehumanless.com/answers/how-to-test-signup-flows-with-playwright-and-real-email-verification

---
More: https://usehumanless.com/llms.txt
