How our QA agents stopped guessing: they run Cypress headless, debug from real evidence, and close the loop from nightly failure to verified fix.
Most AI testing tools stop at writing tests. Ours have to run them.
At AppliedAI, our QA team tests Opus, an AI workflow platform. Over the last few months we turned our Cypress framework into a closed agentic QA loop: a team of AI agents takes a nightly failure, a new feature or an explored bug all the way to a verified fix. A human stays in the loop and makes the decisions.
This post covers what the loop looks like, which Cypress features it uses, and the main lesson: an agent that runs the test does not have to guess.
The loop
One agent sits in the centre: the Team Lead. It starts every run and delegates the work to specialised agents. Each agent has one job:
| # | Agent / stage | What it does |
|---|---|---|
| 01 | Nightly Results | Pulls last night's run from Cypress Cloud, including Test Replay |
| 02 | Product Explorer | Explores the live app as a brand-new user, looking for bugs nobody wrote a test for |
| 03 | Test Planner | Designs manual test cases for a new feature and stores them in Qase |
| 04 | Test Generator | Turns approved cases into UI and API Cypress specs |
| 05 | Test Executor | Runs the specs headless and diagnoses failures |
| 06 | Test Auditor | Checks specs against our conventions and coverage, read-only |
| 07 | Test Healer | Fixes broken tests (stale selectors, changed flows) and opens a PR |
| 08 | Bug Analyzer | Triages every failure with a confidence score, files Jira tickets, routes work to the healers |
| 09 | App Healer | Takes confirmed application bugs and proposes the fix |
The loop closes on itself. A fix shipped by a healer is checked again by the next nightly run, and that run is stage 01 again.
The human in the loop. A QA engineer talks only to the Team Lead. They scope each run, approve the test cases before any code is written, and approve every PR. Agents do the repetitive work: triage, healing and re-runs. People keep the judgement calls.
Run, don't guess
The biggest change was not writing tests faster. It was making agents prove what they say.
An agent that reads a stack trace and the spec source will produce a plausible explanation, and plausible explanations are often wrong. So every claim in our loop needs a run behind it:
- Failures are read from evidence, not from code. The Bug Analyzer pulls the failing test's Test Replay from Cypress Cloud: the DOM at the moment of failure, network calls and console errors. It then classifies the failure as persistent, flaky or new, and as a test bug or an app bug, with a confidence score.
- Every fix is re-run. A healer can't call a test fixed until it passes in a real headless Chrome run.
- Toolchain doubts are tested, not argued. One real example: an agent was about to file an app bug because canvas nodes "never connected". Before filing, it re-ran the same spec in a second browser. The bug only appeared in headless Electron on macOS, where synthetic drag events landed at an offset. That was a toolchain problem, not a product bug. We now run Chrome everywhere, and the agents' guidelines include this check.
The result is less ambiguity. When an agent reports "app bug, 90 % confidence", you can open the replay and see why.
The Cypress toolbox our agents use
None of this needs exotic tooling. It is mostly what Cypress ships today:
- cypress-tap (part of Cypress since 15.21). It lets an agent attach to a live Cypress session from the command line: run a spec, read the verdict, time-travel through the Command Log, and read the app's real DOM and accessibility tree. It is how a healer learns what the page actually renders instead of what the old selector expected.
- Cypress AI toolkit skills. These are Cypress's official agent skills (including the cypress-tap skill). Our own debugging skill builds on them.
-
Cypress Cloud CLI (
cy-cloud). The Bug Analyzer uses it to list runs, failed tests, errors and screenshots, which is the raw material for triage. - cypress-verify-llm, our open-source plugin for asserting on LLM output. Opus is an AI product, so "expected text equals actual text" rarely works. The plugin checks contains, regex, policy, semantic summary, schema, length and repeatability, so tests stay meaningful when the answer is generated.
- Headless Chrome everywhere, locally and in CI, where the nightly suite runs in parallel pods through Cypress Cloud.
New in Cypress 16.4: agents that test in the background
Until now, when an agent drove Cypress through cypress-tap on your machine, the Cypress window and a browser opened on your screen and could pull focus from your editor. Cypress 16.4.0 adds a --headless flag to cypress open:
cypress open --e2e --headless --browser chrome
The agent gets a live session it can inspect with tap, and nothing appears on the screen. 16.4.0 also makes cypress tap status report when the config stops loading or a spec won't compile, so the agent reads the actual error instead of guessing why the session hangs. That fits "run, don't guess" well.
A few things to know: a person can't watch a headless session, it runs until the process is stopped, and after fixing a config error the agent has to restart Cypress. Docs: cypress open --headless.
The parallel trick: isolation, not speed
Several agents running Cypress at the same time sounds like a recipe for flaky chaos. It works for us because each run is isolated from the others:
- Its own git worktree. Parallel generators never write to the same files. The Team Lead merges shared files, such as the command index, in one step at the end.
- Its own fresh user per spec. A Node hook registers and verifies a new user before each spec file starts, so two runs never share an account, data or session state.
- Its own evidence folder. Screenshots, logs and results go to a separate folder per run, so one agent never reads another agent's evidence.
- One Cypress process per spec. A crash or a hung browser takes down one run, not the batch.
-
A clean environment. Agent shells can leak
ELECTRON_RUN_AS_NODE=1from their parent process, and that breaks Cypress, which is itself an Electron app. Every Cypress command we run starts withenv -u ELECTRON_RUN_AS_NODE. It's a small detail that took a long time to find.
With cypress open --headless, the last visible part (a browser window per live session) goes away too.
One caveat: isolation doesn't help against a rate-limited backend. When parallel runs hit a downstream service that throttles, the agents run those specs one after another. Knowing when not to parallelise is part of the guidelines.
Why guidelines matter more than prompts
The agents are only as good as the rules they follow. What makes the loop work is the boring part:
- 17 skills that encode how we work: generate a spec, heal a test, analyse the nightly run, explore the product, file a bug.
-
Conventions enforced by linters, not by memory. Selectors live as data and are never inlined. Assertions come from constants. Tags are derived and checked. Fixed
cy.wait()sleeps are banned. If an agent breaks a rule, a linter fails, not a reviewer's patience. - Shared product knowledge. A product glossary and a list of known and intended behaviours, so the explorer doesn't report a feature as a bug.
- Gates. Agents propose and humans approve, at the plan, the first test and the PR.
With that in place, agents do more than turn tickets into test cases. They test the new feature: they explore it as a real user, refute their own findings with a second agent before filing, and only file what they can reproduce.
What changes for QA automation
For us, the role of the QA automation engineer moved from writing and fixing specs to designing the system that writes and fixes them, and to owning the decisions at the gates.
Next posts in this series will go deeper on individual parts: the Product Explorer, LLM assertions with cypress-verify-llm, and how the healers decide between a test bug and an app bug.
How are you using agents with Cypress? I'd like to compare notes in the comments.

Top comments (1)
When your Product Explorer or Test Executor agent hits a login screen, SSO redirect, or 2FA prompt mid-run, how does the human reviewer step into that live browser session and hand control back?