MailSlurp logo
tests/signup-otp.spec.ts - MailSlurp
TSsignup-otp.spec.ts
tests/e2e/signup-otp.spec.ts
1import { test, expect } from "@playwright/test";
2import { MailSlurp } from "mailslurp-client";
3
4test("sign up with email OTP", async ({ page }) => {
5 const mailslurp = new MailSlurp({ apiKey: process.env.MAILSLURP_API_KEY! });
6 const inbox = await mailslurp.createInbox();
7
8 await page.goto("/signup");
9 await page.getByLabel("Email").fill(inbox.emailAddress!);
10 await page.getByRole("button", { name: "Create account" }).click();
11
12 const email = await mailslurp.waitForLatestEmail(inbox.id!, 30000);
13 const code = email.body!.match(/\b\d{6}\b/)![0];
14 await page.getByLabel("Code").fill(code);
15 await expect(page.getByText("Welcome")).toBeVisible();
16});
mainTypeScript Ln 11, Col 1

Devs love MailSlurp

Create and control, email and SMS on any platform. Add AI, automations, and webhooks to send and receive at scale. REST APIs, Native SDKs, and first-party plugins for all major frameworks.

Trusted by top companies worldwide

  • Broadcom
  • Scraper
  • Trivago
  • Avast
  • Wolt
  • Panasonic
  • Broadcom
  • Scraper
  • Trivago
  • Avast
  • Wolt
  • Panasonic

Features

Programmatic email accounts

Create real programmatic email accounts on demand. Connect them to your systems with APIs, SDKS, webhooks and plugins. Supports custom domains, plus addresses, virtual servers, Gmail and Outlook connections and more.

Powerful functionality

Developer-focused features like content matching, waitFor functions, event monitoring, smart filters and tagging. Bundled in native libraries and intuitive dashboards.

Real phone numbers

Send and receive SMS from anywhere. Real non-VOIP numbers in over 20 mobile networks globally. Provision numbers instantly and in bulk.

AI Automations

Connect forwarding, rulesets, repliers, and AI data transformers to turn emails and attachments into structure and actionable data.

Idempotent scale

Retryable events and queue-backed messaging mean MailSlurp powers reliable email and attachment ingest.

How MailSlurp integrates

Use emails accounts and phone numbers everywhere to test end-to-end, improve delivery, validate content, and process messages at scale.

APIs & SDKs

REST APIs, IMAP/SMTP, native packages in every major language, and powerful functionality for reliable tests + automations.

Framework Plugins

Deep integrations with a wide range of platforms and tools for industry standard testing and automations.

Your Workflows

MailSlurp fits seamlessly into your testing, development, and releases cycles like CI/CD and E2E Q.A.

Global messaging scale

Emails processed

500 million+

Infrastructure that scales.

Mobile networks

20+

Leverage global telecom networks.

Mature platform

10+ years

Stable and dependable.