Verify a signup confirmation or magic linkUse a fresh inbox and fill it into your app’s email field. Wait for the message after the triggering action.
const inbox = await mail.inbox({ new: true });await page.getByLabel("Email").fill(inbox.emailAddress);const after = new Date();await page.getByRole("button", { name: "Send magic link" }).click();const message = await inbox.waitForMessage({ after });await expect(message.urls[0]).toContain("/activate");
Extract a login code from emailUse after immediately before the action that sends the code to avoid matching an older message from the same address.
const inbox = await mail.inbox({ new: true });await page.getByLabel("Email").fill(inbox.emailAddress);const after = new Date();await page.getByRole("button", { name: "Send code" }).click();const message = await inbox.waitForMessage({ after });const match = message.text.match(/\b\d{6}\b/);if (!match) throw new Error("Login code email did not contain a 6-digit code");await page.getByLabel("Code").fill(match[0]);await page.getByRole("button", { name: "Verify" }).click();
Wait for a batch of emailsUse waitForMessages when one action should trigger several emails, such as a team invite or multi-step onboarding sequence. Use delay if your app enqueues email work in the background.
Simulate an inbound emailUse sendMessage when your app receives or reacts to incoming email — for example, a support reply or an automated trigger.
const inbox = await mail.inbox({ new: true });await inbox.sendMessage({ to: ["support@example.com"], subject: "Need help", text: "The test user is asking for support.",});
Send with attachmentsPass an attachments array to sendMessage. Use contentId when the HTML body references an inline file.
const original = await inbox.waitForMessage({});await inbox.sendMessage({ to: [original.from], subject: `Re: ${original.subject}`, text: "Thanks, this worked.",});
QA Wolf includes an Email Allowlist to ensure test emails are delivered only to approved addresses or domains. You must add any email address used in a flow to the allowlist before running the flow.QA Wolf provides internal email domains — qawolf.email and qawolfworkflows.com — for email testing. These are recommended over public email services because QA Wolf controls the servers, which stabilizes tests that rely on email interactions.The platform sets an automatic default address. You cannot delete the default.To add or change the default email address:
1
Click the icon on the upper right. A drawer opens.
2
Click Addresses.
3
Enter the username and domain in the appropriate fields, then click Add.a. You can create as many email addresses as you like in the allowlist.b. To change the default, hover over the address you want to set as default, click the icon, and select Make default.
Use a fresh address for each runPass new: true to generate a unique derived address. This is the right choice for most tests — it isolates each run so old emails from previous runs are never matched.