Finish the email step in your Playwright tests.

Test signups, verification codes and password resets with real inboxes. Wait for the email, use its code or link, and complete the journey in your browser test.

Verification email with a six-digit code ready for a browser test

Trusted by teams at

  • Broadcom
  • Scraper
  • Trivago
  • Avast
  • Wolt
  • Panasonic
  • Broadcom
  • Scraper
  • Trivago
  • Avast
  • Wolt
  • Panasonic

Test the journey your customer takes.

Create an email address, sign up in your app and wait for the message it sends. Extract the verification code or link, then continue the same Playwright test through to the signed-in screen.

Follow the Playwright guide

Verify signup emails

Use the email address created for your test and confirm the account with the message your app actually sends.

Follow magic and reset links

Extract the intended link from the received email, open it in Playwright and assert on the resulting page.

Check one-time codes

Read an OTP from the message and enter it into the browser to complete the verification step.

Let the email move the test forward.

Use the MailSlurp SDK alongside Playwright. Create an inbox for the test and wait for the received message with a timeout, instead of guessing how long delivery will take.

Keep your API key in the test environment. Match the expected sender or subject when a flow sends multiple emails, then assert on the message before using its code or link.

Open the full examples

Give each test its own inbox

Keep an inbox ID with each test or worker so concurrent runs receive the right message.

Wait for the expected message

Use wait helpers and matching conditions. Make missing or unexpected emails fail with a clear assertion.

Check the content too

Assert on links, body text, headers and attachments when they are part of your app's contract.

Playwright email testing questions

How does MailSlurp work with Playwright?

Use the MailSlurp JavaScript or TypeScript SDK inside your Playwright test. Create an inbox, enter its email address in your app, wait for the message, and use the code or link to continue in the browser. Your application sends the real email.

Can I run email tests in parallel?

Yes. Create a separate inbox for each test or worker and keep that inbox ID with the matching browser flow. Tests can wait for their own messages without competing for a shared mailbox. Clean up test accounts and inboxes according to your suite's lifecycle.

How do I wait for an email without a fixed sleep?

Use a MailSlurp wait helper with the inbox ID and a timeout. When a flow can produce more than one message, use matching conditions and assert on the returned email before extracting a link or code.

Can I check more than a verification code?

Yes. Read message content, extract links, inspect headers and download attachments through the API. Add assertions for the details your app depends on. Use separate device rendering and inbox placement tests when you also need real-client appearance or provider-placement coverage.

Your test should reach the other side of the email.

Add a real inbox to your next Playwright test and finish the signup, login or recovery flow.