How to Let an AI Coding Agent Test Your Web App (2026)
The short answer
Pick by where the agent runs: Codex Cloud has a built-in cloud browser and desktop; local agents like Claude Code and Cursor use Playwright MCP or Chrome DevTools MCP; and every agent should end by writing headless Playwright tests you keep. As of December 6, 2026:
- Codex Cloud Browser Use / Computer Use — no setup; the agent tests
localhoston its cloud computer while you watch. - Playwright MCP (Microsoft) — the standard local option: structured accessibility snapshots, no vision model.
- Chrome DevTools MCP (Google) — for debugging: network requests, console with source maps, performance traces.
- Headless Playwright tests — the repeatable layer that runs in CI after the agent is done.
Compared
| Codex Cloud browser | Playwright MCP | Chrome DevTools MCP | Headless Playwright | |
|---|---|---|---|---|
| Runs | OpenAI cloud computer | Your machine | Your machine (live Chrome) | Anywhere, incl. CI |
| Works with | Codex (ChatGPT) | Claude Code, Cursor, VS Code, Claude Desktop, any MCP client | Claude, Cursor, Copilot, Antigravity, any MCP client | Any agent that runs shell |
| How it sees the page | Browser + desktop, screenshots | Accessibility tree | DevTools protocol, screenshots | Test assertions |
| Best at | Reproducing bugs end to end, watch/take over | Clicking through flows | Network, console, performance | Regression tests |
| Version (Dec 6, 2026) | Launched Nov 30, 2026 | v0.0.86, Apache-2.0 | v1.15.0 (Dec 2), Apache-2.0 | — |
| Also a CLI? | codex cloud starts tasks | Playwright CLI + skills recommended | Yes | Yes |
From OpenAI’s Codex documentation and the two projects’ GitHub repositories, read December 6, 2026.
Option 1: Codex Cloud’s browser and desktop
In a Codex Cloud task with Browser Use access, ask Codex to start your app, open http://localhost:3000, change a setting and reload to check it persists — localhost here is the task’s cloud computer. With Computer Use, it can operate other apps on that machine. If Desktop appears in the task’s side panel, you can watch, select Take over to drive it yourself, then Return control. To view only the app in your own browser, use a private HTTP preview. The built-in browser is not available in Codex CLI or the IDE extension; locally, the ChatGPT desktop app has its own browser with a separate profile.
Use it when you already work in Codex and want the agent to reproduce a bug while your laptop is closed.
Option 2: Playwright MCP for local agents
Add npx @playwright/mcp@latest to your client’s MCP config (Node 20+). The agent navigates, clicks and fills forms using accessibility snapshots rather than pixels, which is fast and deterministic. Microsoft’s own README advises that coding agents may do better with the Playwright CLI plus skills, which costs fewer tokens; keep MCP for exploratory testing and long sessions that need a persistent browser.
Option 3: Chrome DevTools MCP for debugging
When a test fails and you need to know why, Chrome DevTools MCP gives the agent what a developer opens DevTools for: network requests, console messages with source-mapped stack traces, screenshots and performance traces with actionable insights, using Puppeteer for reliable automation. Point it at a throwaway Chrome profile — it can read and change everything in the browser.
Option 4: make the agent write tests
Interactive checks prove a fix once. Ask the agent to finish by writing a headless Playwright test that changes the setting, reloads and asserts — OpenAI’s docs describe the same pattern for Codex Cloud — and run it in CI. See how to run AI coding agents in CI/CD.
A workflow that works
- Give the agent the start command, port and the behaviour to verify.
- Let it reproduce the bug in a browser (Codex Cloud, or Playwright MCP locally).
- Switch to Chrome DevTools MCP if the cause is network, console or performance.
- Have it fix the bug, rerun the same flow, then commit a headless test.
More browser-tool detail: Safari MCP vs Chrome DevTools MCP vs Playwright MCP.
Last verified: December 6, 2026.