Skip to main content

How It Works

When your tests need an email address, Testpilot can:
  1. Automatically generate a unique Mailosaur email address
  2. Use this email to receive real emails during test execution
  3. Access the inbox to retrieve verification codes, magic links, or other information
  4. Complete the authentication or verification flow automatically

Setup

1. Create a Mailosaur Account

If you don’t already have one, sign up for a Mailosaur account and retrieve your API credentials. You will need a Mailosaur API Key and Server ID to configure Testpilot.

3. Set Environment Variables

Configure Testpilot to use your Mailosaur account by setting these environment variables:
In CI environments, add these to your secure environment variables.

Using Generated Emails in Tests

Once configured, Testpilot will automatically handle email generation. You don’t need to explicitly specify email addresses in your test scenarios - Testpilot will generate and use them as needed. For example, you can test a signup flow using a unique, randomly generated email as shown below:

Example Test Scenario

Manually Specifying Email Addresses

If you prefer not to use the Mailosaur integration, you can explicitly specify email addresses in your test scenarios:
Note that without Mailosaur integration, Testpilot won’t be able to automatically check inboxes or handle email verification flows, unless you design a test case specifically for this workflow.