Skip to content

QA agents

Video: Hercules on Hearth (1:10).

A QA agent is software that tests an app the way a tester would: it reads a test case or a goal, drives a browser or a phone, decides what to do next from what it sees, and reports what passed, what failed and why. Hearth is the place where its browsers and devices run.

This page shows what a QA agent gets from Hearth, three ways to wire one up, and a worked example with Hercules, the open-source QA agent by TestZeus, which has Hearth built in as its first cloud.

What a QA agent needs from a farm

A QA agent needs Hearth gives it
A clean browser for every test, so one run cannot spoil the next A fresh browser pod per session, deleted afterwards; device sessions get a reset simulator or emulator
Many runs at once, without a per-minute bill Pools that grow with demand up to maxSessions, a fair queue when the farm is full, per-team limits. It runs on your own cluster
To reach the app under test, including staging and internal apps The browsers run in your cluster, next to your apps, so staging needs no tunnel. Telemetry is one setting to turn off
Every engine, and phone simulators and emulators Playwright Chromium, Firefox and WebKit, CDP, Selenium Chrome and Firefox, Appium on iOS simulators and Android emulators
Evidence a person can trust A video of every session, the device log for device sessions, the client and the error, kept with the session
A way to find its own runs again Session names (x-hearth-name, hearth:options.name), and GET /api/sessions?name=
A person in the loop when it gets stuck Live view and take control in the web UI, at <farm>/sessions/<id>
To read the farm itself when a test fails The hearth mcp server: sessions, errors, videos and live screenshots, as tools

Your test code does not change. The agent connects the same way any Playwright, Selenium or Appium client does, with one URL and one key.

Three ways to wire up an agent

1. The agent drives a browser on the farm

The agent's own browser runs in Hearth. Point its Playwright client at the farm and give the session a name, so a person can find it later:

import os
from playwright.sync_api import sync_playwright  # 1.65.x, to match the farm

farm = os.environ.get("HEARTH_URL", "http://localhost:8080").replace("http", "ws", 1)
with sync_playwright() as p:
    browser = p.chromium.connect(
        f"{farm}/playwright/chromium",
        headers={
            "Authorization": f"Bearer {os.environ['HEARTH_KEY']}",
            "x-hearth-name": "agent: checkout applies a coupon",
        },
    )
    page = browser.new_page()
    page.goto("https://staging.example.com/cart")
    # ... the agent's loop: look at the page, decide, act, check ...
    browser.close()

The same works for firefox and webkit, for connectOverCDP at /cdp/chromium, and for Selenium and Appium at /wd/hub with hearth:options.name. See Playwright, Selenium and Mobile devices.

2. The agent writes tests and runs them on the farm

Many agents write a test first, then run it. Run that test on Hearth like any other suite: read HEARTH_URL and HEARTH_KEY from the environment, and keep the Playwright client's major.minor the same as the farm's. Run the same file in CI with the key as a secret. Every run is a session with a video, so a failed generated test can be checked by watching it.

3. The agent reads the farm when something fails

Register the MCP server with the agent (Coding agents):

claude mcp add --env HEARTH_URL=http://localhost:8080 --transport stdio hearth -- hearth mcp

Then the agent can answer "why did the nightly run fail?" by itself. It lists failed sessions, reads each one's error, fetches its video or device log, takes a screenshot of a session that is still running, and gives you the session's page to watch. Without MCP, the same is in the HTTP API:

curl -s -H "Authorization: Bearer $HEARTH_KEY" \
  "$HEARTH_URL/api/sessions?name=agent:%20checkout%20applies%20a%20coupon"
curl -s -H "Authorization: Bearer $HEARTH_KEY" -o video.mp4 \
  "$HEARTH_URL/api/sessions/<id>/artifacts/video.mp4"

A person in the loop

When the agent is unsure (a CAPTCHA on staging, a one-time code, a page it has not seen), open the session's page in the web UI. You see the screen live, click Take control, do the step, and hand it back. The agent keeps the same browser. See The web UI.

Hercules on Hearth

Hercules is TestZeus's open-source QA agent. You write a test case in plain words or Gherkin; Hercules plans it, runs it in a browser, checks every expected outcome and keeps every step's screenshot and decision. Hearth is its first built-in cloud, next to BrowserStack, Sauce Labs and TestMu AI, and the one it recommends: free and self-hosted, with the browsers next to your app. Both send usage telemetry that you can turn off: Hearth's is described in Telemetry, Hercules's in its README.

How they fit together:

  1. Hercules runs a case on your machine and it passes.
  2. hercules cloud run <run-id> --cloud hearth exports the passed run as a pytest-playwright test and runs it in a browser on your farm. Pick Chromium, Firefox or WebKit with --browser.
  3. Hercules names the session after the case, and the cloud run's link is that session's page on the farm: watch it live, take control, play back its video.
  4. hercules cloud bundle <run-id> --cloud hearth writes the same test as a project for CI: pytest tests with HEARTH_URL and HEARTH_KEY set.
  5. Native apps run on the farm's simulators and emulators: set "cloud": "hearth" in a case's mobile section. Hercules uploads the app to the farm and uses its Appium hub.

Try it in five minutes

You need Docker, kind, Helm and kubectl for the local farm, and uv for Hercules.

# 1. A farm on this machine
curl -fsSL https://raw.githubusercontent.com/test-zeus-ai/testzeus-hearth/main/install.sh | sh
hearth up local
export HEARTH_KEY="$(hearth key)"

# 2. Hercules, connected to the farm
uvx testzeus-hercules            # installs `hercules` and sets it up
echo "$HEARTH_KEY" | hercules cloud connect hearth --url http://localhost:8080
hercules cloud check hearth

# 3. Run a case, then run the passed run on the farm
hercules run examples/hercules/login.feature --base-url https://www.saucedemo.com --json > result.json
hercules cloud run "$(jq -r .run_id result.json)" --cloud hearth --browser firefox

Open http://localhost:8080, sign in with the key, and the session is there with the case's name. The ready-made case and more commands are in examples/hercules.

What to know:

  • Versions match. The farm runs Playwright 1.65 by default. If Hercules uses another major.minor, hercules cloud check hearth warns; add a pool for that version (Pools and scaling).
  • Keys stay out of files. Hercules saves the key in ~/.hercules/clouds.env, readable only by you, and the exported tests read it from the environment.
  • Hercules docs: Running tests on clouds and the Hercules feature videos.

Other QA agents

Anything that speaks Playwright, CDP, Selenium or Appium works the same way: browser-use style agents, Playwright MCP, Stagehand, or an agent you built. Give it the farm's URL and a key, name its sessions, and register hearth mcp so it can read what happened.