Email Testing

The Email Testing functions allow you to automate workflows that require email verification, such as user sign-ups, password resets, and notifications. You can create temporary inboxes, wait for incoming messages, and inspect their content directly within your browser automation script.

API Reference

createEmailAddress

Creates a new email address. If no inbox name is specified, a random address will be generated.

const email = await browser.createEmailAddress("Max.huber");

waitForEmail

Wait for a new email to arrive in the specified inbox.

const email = await browser.waitForEmail("Max.huber", 240); // timeout in s

fetchEmails

Returns all emails received by the specified inbox.

const emails = await browser.fetchEmails("Max.huber");

clearEmails

Deletes all emails in the specified inbox.

await browser.clearEmails("Max.huber");

Email usage example

const adresse = await browser.createEmailAddress("myInbox");
// use the adresse.emailAddress to receive an email.
const result = await browser.fetchEmails(adresse.inboxName);
console.log(result.emails)
await browser.clearEmails("myInbox");