Skip to main content
Use waitForMessage(...) when one email should arrive.
const inbox = await mail.inbox({ new: true });

await page.getByLabel("Email").fill(inbox.emailAddress);
await page.getByRole("button", { name: "Send invite" }).click();

const message = await inbox.waitForMessage({});

Avoid Old Messages

Capture after immediately before the triggering action.
const after = new Date();

await page.getByRole("button", { name: "Send invite" }).click();

const message = await inbox.waitForMessage({ after });

Increase The Timeout

const message = await inbox.waitForMessage({
  timeout: 120_000,
});

Use The Parsed Email

const message = await inbox.waitForMessage({});

expect(message.subject).toContain("Welcome");
expect(message.urls[0]).toContain("/activate");
For the exact waitForMessage(...) options and parsed email shape, see the Mail Reference.
Last modified on April 24, 2026