Assrt vs Manual Playwright: The Email Verification Gap
Playwright automates a browser. But your signup flow doesn't end at the browser. It sends a verification email, expects the user to open it, extract a code, and type it back in. Manual Playwright tests can't reach into an inbox. Assrt can, because it ships three email tools as first-class agent capabilities.
“Full signup flow tested in 5 lines of English, including email verification.”
Assrt SDK
1. The Gap Manual Playwright Tests Can't Close
Playwright is excellent at browser automation. It clicks buttons, fills forms, asserts text, takes screenshots. But modern web apps don't live entirely inside the browser tab. A signup flow sends a verification email. A password reset flow sends a magic link. A two-factor auth flow sends an OTP code.
Manual Playwright tests have no built-in way to handle these. The @playwright/test API covers browser actions. Everything outside the browser (receiving email, reading SMS, calling webhooks) requires you to integrate external services, write custom helpers, and manage API credentials.
This is where most teams give up on end-to-end testing for auth flows. They mock the email step, or they skip it entirely. Either way, the most critical user journey in the app goes untested.
2. Three Email Tools in agent.ts
The Assrt SDK defines 18 tools that its AI agent can call during test execution. Three of them handle email:
create_temp_email
Creates a disposable email inbox on demand. Returns a fully-functional email address the agent can use to sign up for your app. No Mailosaur account, no API key, no configuration.
wait_for_verification_code
Polls the disposable inbox until an email arrives, then extracts the verification code or magic link. Handles the retry logic, timeout, and HTML parsing internally. Returns the code as a plain string the agent can type into the browser.
check_email_inbox
Reads the full contents of the inbox, including email subject lines and HTML bodies. Useful for asserting that a confirmation email was sent, that it contains the right content, or that a welcome email arrived after signup.
These tools are defined in src/core/agent.ts of the @assrt-ai/assrt npm package. They sit alongside the 15 browser tools (navigate, click, type_text, assert, screenshot, and so on) as equal participants in the agent's tool set. The agent calls them the same way it calls any other tool: by deciding, based on the test step and current state, that it needs to interact with email.
In a plain English test plan, using these tools looks like this:
#Case 1: Full signup with email verification
1. Create a temporary email address
2. Navigate to the signup page
3. Type the temp email into the email field
4. Type a password into the password field
5. Click Sign Up
6. Wait for the verification code in the email
7. Type the verification code into the OTP input
8. Click Verify
9. Verify the dashboard loadsTest your signup flow today
Install Assrt, point it at your staging URL, and test the full signup flow (including email verification) in under two minutes.
Get Started →3. What Email Testing Looks Like in Manual Playwright
To test the same signup flow in manual Playwright, you need to:
- Choose an email service. Mailosaur, Mailhog, Ethereal, or a custom SMTP trap. Each has its own API, pricing, and limitations.
- Install and configure the SDK.Add the service's npm package, create an API key, store it in environment variables, and initialize the client in your test setup.
- Write inbox helpers. Create a function that generates a unique inbox address, another that polls for new messages with exponential backoff, and another that parses the HTML email body to extract a 6-digit code or a link.
- Wire it into the test. Call the helpers between Playwright actions, pass the extracted code back to
page.fill(), and add timeout logic for slow email delivery. - Handle CI environments. Make sure the email service is accessible from CI, that API keys are available as secrets, and that inbox cleanup runs between test suites.
A typical implementation adds 50 to 100 lines of setup code before you write a single assertion. Here is a simplified version:
import { test, expect } from '@playwright/test';
import Mailosaur from 'mailosaur';
const mailosaur = new Mailosaur('your-api-key');
const serverId = 'your-server-id';
test('signup with email verification', async ({ page }) => {
const email = `test.${Date.now()}@${serverId}.mailosaur.net`;
await page.goto('https://myapp.com/signup');
await page.getByLabel('Email').fill(email);
await page.getByLabel('Password').fill('SecurePass123!');
await page.getByRole('button', { name: 'Sign Up' }).click();
// Poll Mailosaur for the verification email
const message = await mailosaur.messages.get(serverId, {
sentTo: email,
}, { timeout: 30000 });
// Parse the OTP from the email body
const match = message.html.body.match(/\d{6}/);
const code = match?.[0] ?? '';
await page.getByLabel('Verification code').fill(code);
await page.getByRole('button', { name: 'Verify' }).click();
await expect(page.getByText('Dashboard')).toBeVisible();
});This requires a Mailosaur account (starting at $99/month), an API key stored as a CI secret, regex parsing for the verification code, and timeout handling for slow delivery. If your email template changes and the code is no longer a 6-digit number, the regex breaks silently.
4. Side-by-Side: Signup Flow Test
| Aspect | Manual Playwright | Assrt |
|---|---|---|
| Email service setup | External (Mailosaur, Mailhog, etc.) | Built-in (create_temp_email) |
| API keys required | Yes (email service credentials) | No |
| OTP extraction | Custom regex or HTML parser | wait_for_verification_code returns the code |
| Lines of test code | 20 to 40 lines (plus helper setup) | 9 lines of plain English |
| Email template changes | Regex may break silently | AI agent adapts to new format |
| Monthly cost (email service) | $99+ (Mailosaur) or self-hosted Mailhog | Included (pennies per run for LLM calls) |
| CI configuration | Secrets for API keys, service connectivity | Same setup as local (URL + plan) |
| UX feedback | Pass/fail only | suggest_improvement tool flags UX issues |
5. Beyond Email: UX Feedback That Tests Don't Give You
Manual Playwright tests are binary: they pass or they fail. They tell you whether the assertion matched. They never tell you that the loading spinner was missing, or that the error message was confusing, or that the form submitted without visual feedback.
Assrt's agent has a tool called suggest_improvement that it can call at any point during a test run. The structured output includes a title, severity level (minor, major, critical), and a description of the issue. These show up in the results JSON alongside pass/fail data.
For example, while testing a signup flow, the agent might notice that clicking "Sign Up" shows no loading indicator. It calls suggest_improvement with:
{
"title": "No loading state after form submission",
"severity": "major",
"description": "After clicking Sign Up, the button remains
static with no spinner or disabled state. Users may
click it multiple times, creating duplicate accounts."
}This transforms testing from "did the code work?" to "is the experience good?" Manual Playwright tests will never surface these insights because they only check what you explicitly assert. The agent checks everything it sees.
See the difference yourself
Run Assrt against your staging signup flow. Get pass/fail results, video replay, and UX improvement suggestions in one report.
Get Started →6. Frequently Asked Questions
What email tools does Assrt include?
Three tools defined in the agent's tool set: create_temp_email generates a disposable inbox on demand, wait_for_verification_code polls that inbox for an OTP or verification link and returns it, and check_email_inbox reads full email contents including HTML body. These are first-class tools the AI agent can call directly from natural language test steps, with no external service setup required.
How do you test email verification in manual Playwright?
You integrate a third-party email service like Mailosaur, Mailhog, or Ethereal. Then you write helper functions to create inboxes via API, poll for incoming emails with retry logic, parse the HTML body to extract verification codes, and pass them back to the browser test. This typically adds 50 to 100 lines of setup code plus per-service API credentials.
Does Assrt support testing two-factor authentication flows?
Yes. You write a step like 'Wait for the verification code in the email inbox' and the agent calls wait_for_verification_code, which polls the disposable inbox until a message arrives. Once it extracts the code, the agent types it into the OTP input field on the page. The entire 2FA flow is handled without any custom code.
Can Assrt test OAuth and SSO login flows?
Assrt can test any flow that happens in a browser. For OAuth redirects, the agent follows the redirect chain, interacts with the provider's login form, and returns to your app. If the OAuth flow sends a verification email, the built-in email tools handle that part. SSO flows that require SAML or enterprise IdP configuration need the IdP to be accessible from the test environment.
What is the suggest_improvement tool?
Unlike manual Playwright tests which only report pass or fail, Assrt's agent can call a suggest_improvement tool to flag UX issues it notices during testing. The structured output includes a title, severity level, and description. For example, if a form submission shows no loading state, the agent may flag 'No visual feedback after form submit' as a major improvement. Manual Playwright tests will never tell you about UX problems you didn't explicitly assert.
Is Assrt free to use?
Yes. Assrt is MIT licensed and ships as an npm package (@assrt-ai/assrt). You pay only for the LLM API calls that power the agent, typically a few cents per test scenario. There is no subscription, no seat pricing, and no vendor lock-in. Manual Playwright is also free, but the engineering time to write and maintain tests is the real cost.
Can I use Assrt and Playwright together?
Absolutely. Assrt runs on Playwright MCP under the hood. You can use Assrt for full-flow tests that cover signup, email verification, and happy paths, while keeping manual Playwright tests for performance-critical paths, visual regression, or cross-browser coverage (Firefox, WebKit) that Assrt does not support yet.
Ready to automate your testing?
Assrt discovers test scenarios, writes Playwright tests from plain English, and self-heals when your UI changes.