Playwright
Sign-up flows with disposable inboxes + OTP extraction.
import { test, expect } from "@playwright/test";
import { Ephemail } from "@ephemail/sdk";
const ephemail = new Ephemail({ apiKey: process.env.EPHEMAIL_KEY! });
test("sign-up flow", async ({ page }) => {
const addr = await ephemail.addresses.create({ ttlSeconds: 600 });
await page.goto("/signup");
await page.getByLabel("Email").fill(addr.email);
await page.getByRole("button", { name: "Sign up" }).click();
const msg = await ephemail.addresses(addr.email).waitForMessage({
matchSubject: /verify/i, withOtp: true, timeoutMs: 60_000,
});
await page.getByLabel("Code").fill(msg.otp!);
await expect(page.getByText("Welcome")).toBeVisible();
});