---
title: "Playwright | Proxy Mail QA"
description: "A Playwright test that signs up with a disposable Proxy Mail QA address and enters the verification code from the email, using the proxymail-qa package."
url: https://proxymail.qa/docs/playwright
---

# Playwright

Install the [proxymail-qa](https://www.npmjs.com/package/proxymail-qa) package and keep the [API key](https://proxymail.qa/docs/api-keys) in `PROXYMAIL_QA_API_KEY`:

Terminal window

```bash
npm install --save-dev proxymail-qa
```

Create an address, sign up with it, then wait for the code:

signup.spec.ts

```ts
import { expect, test } from '@playwright/test';
import { ProxyMailQA } from 'proxymail-qa';

const qa = new ProxyMailQA(); // reads PROXYMAIL_QA_API_KEY

test('sign-up sends a working code', async ({ page }) => {
  const { address, password } = await qa.createAddress({ persona: true, password: true });
  const submitted = new Date();

  await page.goto('/signup');
  await page.getByLabel('Email').fill(address);
  await page.getByLabel('Password').fill(password);
  await page.getByRole('button', { name: 'Sign up' }).click();

  const { value } = await qa.waitForCode(address, { since: submitted });
  await page.getByLabel('Code').fill(value);
  await expect(page).toHaveURL(/welcome/);

  await qa.deleteAddress(address);
});
```

`since` makes the wait ignore anything sent before the form was submitted, so a retry never picks up an old code. Waits hold for up to 30 seconds; pass `timeout` for longer.

For a link instead of a code:

```ts
const { value: link } = await qa.waitForLink(address, { type: 'verify', since: submitted });
await page.goto(link);
```

If nothing arrives, the error says why as far as Proxy Mail QA can tell, for example that your app’s email provider only sends to verified addresses. The package also covers dates of birth and countries on personas, app links, the email’s HTML for template tests, and unusual addresses: see its [README](https://www.npmjs.com/package/proxymail-qa). For running in CI, see [Running in CI](https://proxymail.qa/docs/ci).

Prefer plain HTTP? Every call is in the [REST API](https://proxymail.qa/docs/rest-api) guide.

[Previous Node.js client](https://proxymail.qa/docs/node.html) [Next Cypress](https://proxymail.qa/docs/cypress.html)
