Momentic is a managed testing platform for the web with its own MCP server. A coding agent (Cursor, Claude Code, Codex, any MCP client) previews each candidate step against the live page, gets a screenshot back, and only commits the step on success. Saved tests are YAML, executed on a managed runner with a multi-modal step cache and auto-heal so generated tests replay deterministically. Playwright MCP is Microsoft’s open-source MCP server. It lets a coding agent (Cursor, Claude Code, VSCode Copilot) drive a browser, capture snapshots, and synthesize Playwright tests. It’s well-suited to teams already on Playwright who want to assist authoring with a coding agent and end up with standard Playwright code.Documentation Index
Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Speed and caching
| Momentic | Playwright MCP | |
|---|---|---|
| What’s cached | Multi-modal locator data per step (docs). | Nothing. PW MCP is an authoring tool; generated Playwright tests don’t cache either. |
| Waiting | Built-in: navigation, load, screenshots, DOM mutations, same-origin requests. 3s default, configurable. | Generated tests use hard-coded waitForTimeout; manual waitForResponse per request. |
| Agent context per step | Screenshot + short status. Locator resolution / assertion evaluation happens server-side, outside the agent’s prompt. | Full browser snapshot per browser_* tool call (DOM + a11y tree + console). Accumulates across the session. |
| Runtime hit cost | Milliseconds, no LLM call. | N/A. Speed is whatever Playwright config + hard-coded waits allow. |
| Heal on miss | Re-resolves and updates the entry in place mid-run. | N/A. A broken selector is a test failure. |
How the multi-modal cache works
A cached step stores more than one way to find the target: where it sits on screen, what it looks like, what text it contains, and the structural and accessibility attributes around it. Which of those signals matters for a given step is inferred from the natural-language description. “The red Cancel button below the Order Summary header” leans on visual and positional signals; “the Submit button in the form” leans on structure and role. When a step replays, the runner checks the stored signals against the live page and runs the action without invoking the LLM when there’s a match.What happens on replay
The authoring loop only matters if the generated artifact survives the next day. Take this generated Playwright spec the day after authoring, against the same app with one change: the team replaced the static welcome string with a personalized one ("Welcome, Ada" -> "Hi Ada, welcome back").
Playwright MCP, replay:
page.locator('input[type="email"]').fill(...)and the subsequent interactions resolve normally.page.waitForTimeout(2000)blocks for 2s regardless of whether the page is ready.expect(page.getByText("Welcome, Ada")).toBeVisible()fails. The text was guessed from the snapshot the agent saw during authoring; it no longer matches.- The CI job is red. The maintainer either re-runs the MCP authoring loop from scratch or hand-edits the spec to use a different selector. Either way it’s a code review.
type/clicksteps hit the cache and run in milliseconds.assert: The dashboard chart is visible and not cut offis evaluated by the assertion agent against the current page state. The agent reasons over the intent of the assertion, not a literal string match, so the rephrased welcome banner doesn’t trip it.- The test passes. No code review needed.
Why context grows for Playwright MCP
Why context grows for Playwright MCP
Each MCP tool call (
browser_click, browser_snapshot, browser_navigate,
…) returns a structured snapshot of the page: rendered DOM, a11y tree, and
console messages. The agent’s prompt history accumulates every snapshot from
every tool call in the session.Momentic’s MCP server returns a compressed screenshot plus a short status from
each preview / run call. Snapshot expansion happens server-side during locator
resolution; the full DOM is only returned when the agent explicitly asks for the
session state. Locator resolution runs against the cache first; cache hits
return without invoking the LLM at all.Authoring loop
| Momentic | Playwright MCP | |
|---|---|---|
| Loop | Preview each step against the live page -> commit on success. | Interact through the browser from memory -> generate Playwright code at the end. |
| Generated artifact | act / assert / extract step targeting user intent. | locator / getByRole / expect / waitForTimeout materialized at generation time. |
| Editing a test | Splice individual steps; browser session persists across edits. | Full browser and session reset; agent replays from memory. |
| Hidden / transient UI | Interacts with aria-disabled, 0-opacity, 0-bbox elements when user-reachable. | Often fails on Chakra-style hidden / transient elements. |
| Supported clients | Cursor, Claude Code, Codex, any MCP client. | VSCode, Claude Code. |
Agent rule for direct YAML edits
Agent rule for direct YAML edits
Add to
AGENTS.md so the coding agent doesn’t edit YAML directly (which
causes parsing and cache errors). See
the integration docs.Generated artifact side-by-side
Playwright MCP (after running the flow once from memory):2000ms wait was inserted
because the agent saw a transient loading state. Replay often fails on one or
both.
Agentic v2 (each step previewed live before commit):
A more realistic test
The hello-world above doesn’t show the v2 surface. A representative checkout regression with module reuse, parameter inputs, typed extraction, and a conditional looks like this:checkout.test.yaml
../modules/sign-in.module.yaml