Manual Playwright vs Assrt: Same Browser Engine, Zero Test Code
Assrt runs on Playwright's browser engine. But it never generates a .spec.ts file. Instead, an AI agent reads your plain English test plan and interprets it at runtime, calling Playwright MCP tools to drive the browser. This page explains what that means technically and when it makes more sense than writing Playwright tests by hand.
“Tests that survive every refactor because they never reference your code.”
Assrt architecture
1. How Manual Playwright Tests Work
A standard Playwright test is a TypeScript file that imports @playwright/test, defines test cases with test() blocks, and uses locator APIs to interact with the page. You write selectors, assertions, and control flow in code. The test runner executes the file, launches a browser, and reports pass/fail.
import { test, expect } from '@playwright/test';
test('user can log in', async ({ page }) => {
await page.goto('https://myapp.com/login');
await page.getByLabel('Email').fill('user@test.com');
await page.getByLabel('Password').fill('secret123');
await page.getByRole('button', { name: 'Sign In' }).click();
await expect(page.getByText('Dashboard')).toBeVisible();
});This works well. But every line is a commitment. The selector getByLabel('Email')assumes an element with that accessible label exists. If the label changes to "Email address" during a redesign, the test breaks even though the feature still works. Multiply this across hundreds of tests and maintenance becomes a second job.
2. How Assrt Works (the No-Code Layer)
Assrt uses the same browser engine (Chromium via Playwright) but removes the code layer between your intent and the browser. You write a test plan in plain English:
#Case 1: User can log in
1. Navigate to the login page
2. Type user@test.com into the email field
3. Type secret123 into the password field
4. Click the Sign In button
5. Verify the Dashboard heading is visibleNo imports. No async/await. No selectors. This text gets parsed and handed to an AI agent (Claude Haiku) that reads the live page through the accessibility tree, decides which elements correspond to your descriptions, and issues tool calls through Playwright MCP to interact with them. The plan stays as text. The code never gets written.
If the label changes from "Email" to "Email address," the AI agent still finds the email input because the accessibility tree still reports an input with a name that semantically matches. No test update required.
3. Inside the TestAgent: What Actually Happens at Runtime
The core of Assrt is the TestAgent class in the SDK (located in src/core/agent.ts of the @assrt-ai/assrt npm package). Here is what it does for each test run:
- Parse the plan. The agent splits your text on the regex
/(?:#?\s*(?:Scenario|Test|Case))\s*\d*[:.]/gi. Each match becomes one scenario to execute independently. - Call snapshot. For each scenario, the agent first calls the Playwright MCP
snapshottool, which returns the accessibility tree as text. Every interactive element gets a ref ID likee5,e12,e47. - Match and act. The LLM reads the accessibility tree and your natural language step, then responds with a tool call:
click(element: "Sign In button", ref: "e5"). This call goes to Playwright MCP, which calls the real Playwright API. - Assert. The agent uses an
asserttool that takes a description and a boolean. Noexpect()calls, no assertion library. The agent describes what it checked and whether it passed, with human-readable evidence. - Report. Results are structured JSON:
passedCount,failedCount,totalDuration, and per-scenario breakdowns with each assertion and its evidence string.
At no point does the TestAgent invoke a code generation function. It does not produce a .spec.ts, .test.ts, or any JavaScript file. The entire execution is tool calls interpreted at runtime. Your test plan in /tmp/assrt/scenario.md is the only artifact, and a file watcher syncs edits to cloud storage within one second.
Try it yourself
Install Assrt in your IDE, point it at your staging URL, and run your first test in under a minute. No test code to write.
Get Started →4. Side-by-Side Comparison
| Aspect | Manual Playwright | Assrt |
|---|---|---|
| Test format | TypeScript .spec.ts files | Plain English with #Case markers |
| Element targeting | CSS selectors, getByRole, getByLabel, data-testid | Accessibility tree refs (e.g. e5, e12) |
| Assertions | expect() API with matchers | AI agent assert tool with natural language evidence |
| Execution speed | 5 to 30 seconds per test | ~60 seconds per scenario (agent overhead) |
| Maintenance cost | Update selectors and assertions when UI changes | Edit plain text descriptions if the feature changes |
| Skills required | TypeScript, Playwright API, async patterns | Ability to describe what the feature should do |
| Code generated | You write and maintain every line | Zero lines written to disk |
| Cost | Free runtime, engineering time for authoring | Free (MIT), pennies per run for LLM calls |
| Debugging | Stack traces, Playwright Trace Viewer | Video replay, reasoning chain, assertion evidence |
| Browser engine | Chromium, Firefox, WebKit | Chromium (via Playwright MCP) |
5. When to Use Which
Use manual Playwright when you need sub-second test execution, cross-browser coverage (Firefox, WebKit), pixel-level visual regression testing, or when your team already has a mature test suite and dedicated QA engineers who maintain it.
Use Assrt when you have no test suite and need coverage fast, when your frontend changes frequently and selector maintenance is eating engineering hours, when your team lacks Playwright expertise, or when you want to integrate testing into an AI coding workflow (Claude Code, Cursor) where the agent can run tests after every change without writing code.
The two approaches are not mutually exclusive. Assrt can cover your happy-path flows and catch regressions with zero code investment while your team writes targeted Playwright tests for performance-critical paths or visual edge cases that need pixel precision.
6. Frequently Asked Questions
Does Assrt generate Playwright .spec.ts files?
No. Assrt never writes test code to disk. The TestAgent class in the SDK parses your plain English scenarios (splitting on #Case markers with a regex), then sends each scenario to an LLM agent. The agent responds with tool calls like click, type_text, and assert, which are routed through Playwright MCP to the browser. The test definition stays as human-readable text. The execution is entirely interpreted at runtime.
If Assrt doesn't generate code, how does it use Playwright?
Assrt connects to Playwright through the Model Context Protocol (MCP). Playwright MCP exposes browser actions as tool calls: navigate, click, type, snapshot, screenshot. The AI agent calls these tools the same way a human tester would interact with a browser, but programmatically. Playwright handles the actual browser automation. Assrt handles the decision-making about what to click and what to verify.
How does Assrt find elements without CSS selectors?
Assrt calls the snapshot tool, which reads the browser's accessibility tree. Every interactive element gets a temporary ref ID (like e5, e12, e47) along with its role, name, and state. The AI agent matches your natural language step ('Click the Sign In button') to the correct ref in the tree. Refs are recomputed on every snapshot, so they always reflect the current page state regardless of DOM structure changes.
What does an Assrt test plan look like?
A plain text file with #Case markers. For example: '#Case 1: Login flow' followed by '1. Navigate to the login page 2. Type test@example.com into the email field 3. Click Continue 4. Verify the dashboard loads.' No imports, no async/await, no page object models. Editable in any text editor, version-controllable in git.
Is Assrt slower than running Playwright tests directly?
Yes. A Playwright .spec.ts test typically runs in 5 to 30 seconds. An Assrt scenario takes roughly 60 seconds because the AI agent needs to read the accessibility tree, decide what to do, and issue tool calls sequentially. The tradeoff is that you spend zero time writing or maintaining test code. For teams where writing and fixing tests costs more engineering hours than the extra runtime, Assrt is faster end to end.
Can I run Assrt in CI/CD?
Yes. The Assrt MCP server ships as an npm package (@assrt-ai/assrt). You can invoke it from any environment that supports MCP, including Claude Code in headless mode. Tests run against a URL you provide, so they work the same way in CI as on a developer's machine. Results are structured JSON with pass/fail status, assertions, and evidence.
What does Assrt cost compared to writing Playwright tests manually?
Assrt is MIT licensed and free. You pay for LLM API calls (Claude Haiku) that power the agent, typically a few cents per test run. Manual Playwright has no runtime cost but requires engineering time to write, debug, and maintain every test. For a 50-test suite, expect 2 to 4 weeks of initial engineering effort with Playwright, plus ongoing maintenance as the UI changes. With Assrt, you write the same suite in an afternoon.
Ready to automate your testing?
Assrt discovers test scenarios, writes Playwright tests from plain English, and self-heals when your UI changes.