Skip to content
Facteur

Change provider without rewriting your tests

The real cost of changing testing tool is not the subscription: it is the day spent rewriting assertions that worked. Here, a few lines per file change, and the shape of the test stays yours.

The same test, with Mailosaur then with Facteur

Both wait for the message. The inbox id replaces the serverId, and the code is read from a field of the message.

Before, with Mailosaur JavaScript
// The Mailosaur client, and the code looked up in the body.
const MailosaurClient = require('mailosaur');
const mailosaur = new MailosaurClient(process.env.MAILOSAUR_API_KEY);

// Waits for the first matching message, 10 seconds by default.
const message = await mailosaur.messages.get(serverId, {
  sentTo: address,
});

const code = message.html.codes[0].value;
Every Mailosaur call shown here comes from its documentation: the Sources section, further down, gives the page and the date it was read.
After, with Facteur TypeScript
import { Facteur } from '@facteur-eu/sdk';
const facteur = new Facteur(); // reads FACTEUR_API_KEY

// Searches every second and returns the message as soon as it arrives, 30 seconds at most.
const message = await facteur.messages.waitFor({
  inbox: 'j3k9x2mq',
  sentTo: address,
  timeout: 30_000,
});
const { messages } = await response.json();

// The code is already extracted, in a field of its own.
const code = messages[0].otp;
The Facteur SDK installs with npm i -D @facteur-eu/sdk, and the code arrives already extracted in the otp field.

Four differences, each one checkable

What is written here about Mailosaur comes from the sources at the bottom of the page.

01

Volume is not counted per day

Mailosaur's Personal and Core plans state their volume based on a daily limit. At Facteur, the included volume counts over the billing period; only the overage is bounded per day.

02

SMS planned in the same tool

At Mailosaur, SMS is shown separately on the Core plan. At Facteur, an SMS inbox is read with the same call as an email inbox.

03

A cap per inbox, with its alerts

On paid plans, a cap per inbox and alert thresholds by email: a test stuck in a loop stops on its own cap instead of using up the whole organization's volume.

04

The code arrives already extracted

The otp field holds the most likely code, codes all the ones found, links the links. What your tests read in html.codes becomes a field at the top level of the message.

Five steps, none irreversible

  1. Step 01

    Create an account and an inbox

    The free plan is enough to validate the migration. Note the inbox id: it plays the part of the serverId.

  2. Step 02

    Move a single test

    Replace the client and the call that waits for the message with Facteur's search, then run that test: if it passes, your suite will.

  3. Step 03

    Run the suite twice

    Keep Mailosaur in parallel for a week, long enough to compare pass rates. Nothing asks you to cancel before you are convinced.

  4. Step 04

    Set your caps and your alerts

    A cap per inbox and alert thresholds, on paid plans. Alerts go out by email, and from Solo up to a Slack or Discord channel, or as an incident in PagerDuty or OpsGenie.

  5. Step 05

    Move the other files at your pace

    File by file, from the flakiest to the calmest. Both tools live together as long as you want.

Conversion table of the API calls

Where each of your calls lands, if you call the API directly. The rows with no equivalent say so: better to read it here than to find out mid-migration.

At Mailosaur At Facteur Good to know
GET /api/servers source
GET /inboxes
A Mailosaur server is called an inbox. Each has an eight-character id and its own domain.
POST /api/messages/search source
GET /messages
The criteria are parameters of the address: sentTo, subject, otp, hasOtp and others. match=any joins them with an "or", and since keeps out the messages that arrived before. The search answers at once: send it again every second, or let the SDK's waitFor do it.
GET /api/messages/:id source
GET /messages/{messageId}
The full message: otp, codes, links, the body as text and HTML, the headers.
GET /api/files/attachments/:id source
GET /attachments/{attachmentId}
The content of the attachment.
GET /api/files/email/:id source
No route
The public API does not serve the raw source of a message.
GET /api/analysis/deliverability/:id source
No route
No SPF, no DKIM, no DMARC, no spam score.
POST /api/devices/otp source
No route
An authenticator app's code is computed in the test, in twenty lines of Node: the OTP guide gives them.
GET /api/usage/limits source
GET /capacity
The organization's credits: the plan's volume, the packs, what is left of each and when it expires.
  • Rendering previews across mail clients and the visual editor have no equivalent at Facteur, and will not: it is not the same product.

  • The migration guide of the developers' portal covers these calls in detail: the authentication header, the shape of refusals, the states of a message.

What Mailosaur publishes

Each line is something Mailosaur publishes. It carries the address of the page where we read it and the date we read it. What we could not check is not here. These pages change: read the source again before you decide.

  1. 01

    The pricing page shows three plans: Personal from $20 per month and Core from $50 per month, billed annually, and Enterprise on quote.

    https://mailosaur.com/pricing ·

  2. 02

    The Personal plan shows 15,000 inbound emails per month, based on a daily limit of 500. The Core plan shows 75,000 inbound emails per month, based on a daily limit of 2,500.

    https://mailosaur.com/pricing ·

  3. 03

    The Personal plan includes one inbox, with unlimited email addresses. The Core plan includes multiple inboxes.

    https://mailosaur.com/pricing ·

  4. 04

    On the Core plan, the page shows "SMS and authentication" from $37.50 per month, and email previews from $25 per month.

    https://mailosaur.com/pricing ·

  5. 05

    The Node client installs with npm install mailosaur and is built with new MailosaurClient(key). Its messages.get(serverId, { sentTo }) method waits for the first matching email, 10 seconds by default, a delay the timeout option extends.

    https://mailosaur.com/docs/email-testing/nodejs ·

  6. 06

    The codes found in a message are in the html.codes and text.codes arrays, each with a value property.

    https://mailosaur.com/docs/test-cases/codes ·

  7. 07

    The API reference documents GET /api/servers, POST /api/messages/search, GET /api/messages/:id, GET /api/files/attachments/:id, GET /api/files/email/:id (the .eml file), GET /api/analysis/deliverability/:id, POST /api/devices/otp and GET /api/usage/limits.

    https://mailosaur.com/docs/api ·

Frequently asked questions

Do I have to rewrite the tests to migrate?

No. The client and the call that waits for the message change; the assertion often gets shorter, because the code arrives already extracted in a field. The structure of your tests does not move.

What happens to the messages already received at Mailosaur?

They stay at Mailosaur. They are test data: they come back on the next run of your suite. There is nothing to export and no DNS switch to plan.

What does a daily limit change?

A suite that runs hard on a release evening can hit a daily limit even when the month is quiet. At Facteur, the included volume is the period's; beyond it, packs or pay-as-you-go overage, bounded per day under your spending cap. Prices are on the Pricing page.

Why try it today?

Because the switch is measured in files: you try it on a single test before deciding, and both tools live together as long as needed.

Try the migration on a single file

The free plan asks for no credit card. One file, a few lines, and you will know.