---
title: "AI testing agents in pull-request CI: open source vs. managed"
description: "Compare open-source agents with managed QA, choose unit, API, or browser coverage, and try a repeatable GitHub Actions check on one pull request."
canonical: "https://momentic.ai/blog/ai-testing-agents-managed-qa-pull-request-ci"
last-updated: "2026-11-28T01:08:13Z"
---

# AI testing agents in pull-request CI: open source vs. managed

URL: https://momentic.ai/blog/ai-testing-agents-managed-qa-pull-request-ci

[blog](/blog) [/ engineering](/blog/category/engineering)  / ai-testing-agents-managed-qa-pull-request-ci

Engineering

Compare open-source agents with managed QA, choose the right test artifact for CI, and try one browser check on a pull request.

AI testing tools can help explore a browser flow, author a test, or run checks in CI. Those are related jobs, but they are not the same thing. Before comparing tools, decide what must exist at the end: a unit test, an API case, or an executable browser test with a pass/fail assertion.

This guide focuses on when CI needs a browser-level artifact and how to run it against each pull request. It is not a general browser-tool ranking. For a broader regression-testing comparison of Browser Use, Stagehand, Playwright, and Momentic, see [Is Browser Use good enough for regression testing?](https://momentic.ai/blog/browser-use-regression-testing).

Browser checks complement unit and API tests: they verify a user-visible journey in a running app, while unit and API tests cover different layers. A browser agent’s “done” message is not by itself proof that the application met an expectation; the test still needs an observable outcome.

## Choose the test artifact first

“Automatic test generation” can mean several outputs:

| Need | Example artifact | What to evaluate |
| --- | --- | --- |
| Code-level coverage | Unit or component test checked into the codebase | What source or change the generator used, whether the assertion is meaningful, and whether the test runs in the existing unit-test job |
| API coverage | Request/response case, contract check, or integration test | How the case is derived, what environment and data it needs, and whether failures distinguish product behavior from service outages |
| Browser end-to-end coverage | A repeatable test for a user journey, such as signing in and seeing the account page | Where the test is stored, how it reaches the app, what it asserts, how CI reports failures, and who repairs it |

A browser agent can assist with the last item. Do not compare it to a unit- or API-test generator using only the label “AI testing.” First make sure each candidate is being asked to produce the same kind of artifact.

## Four ways to build a browser check

These approaches differ in the artifact that enters the pull request and who owns the gate.

| Approach | CI artifact | Who owns the pull-request gate |
| --- | --- | --- |
| Stagehand | A project test or script that uses Stagehand browser APIs and runs in the project’s test runner | Your team owns the runner, fixtures, assertions, browser and model configuration, retries, logs, and failure triage |
| Browser Use | Python agent code plus an independent test-runner assertion | Your team owns the stable test oracle, model and browser setup, usage, retries, results, and triage |
| Playwright MCP + coding agent | The agent helps author a Playwright test; the reviewed test is committed and runs under Playwright Test | Your team reviews the generated code and owns test data, selectors, assertions, runner configuration, and CI failures; the agent is not needed in the PR job |
| Momentic | A YAML test in the repository, run from GitHub Actions with the Momentic CLI | Your team defines the flow and expected result, handles CI secrets, reviews usage and results, and decides which failures block a merge |

These approaches can be combined. For example, use Playwright MCP to explore a flow and draft a conventional Playwright test, then review and run that test with the normal CI workflow.

## Keep CI assertions explicit

Intent-driven APIs can help when an element is awkward to locate. Stagehand’s `act()`, `observe()`, and `extract()`, Browser Use’s agent loop, and Momentic’s AI actions express browser work at a higher level in different ways. They change how a step is authored, not who owns the test artifact or what a pull-request check must prove. Keep an observable application-state assertion and assign an owner for model access, browser setup, and failure triage.

For a merge gate, keep the expected outcome explicit. “The agent completed the task” is weaker than an assertion such as “the signed-in user sees the account heading and the expected account identifier.” Browser Use’s documentation distinguishes a completed run from the agent’s success verdict; it recommends independently verifying important external actions. Apply the same discipline to every tool.

Scripted Playwright tests are a strong choice when a stable locator and a precise assertion already express the requirement. They provide a familiar test runner, explicit expectations, isolation, and CI reports. An AI-driven step may reduce some locator authoring, but it adds model and runtime variables that should be measured. Many teams will use both: scripts for stable, high-value gates and an agent-assisted workflow for authoring or flows where higher-level intent is useful.

## What you build yourself

The open-source options reduce license cost for the code, not the work required to make a reliable CI check.

- **Credentials and execution.** Decide whether the browser is local or hosted, which model/provider is used, and where each secret is stored. Do not place API keys in source files or logs.
- **The test oracle.** Convert the user journey into an observable assertion. An agent’s final text is not a replacement for checking the application state.
- **Repeatability.** Pin dependencies and commit the lockfile; choose stable test data and a non-production target; set bounded timeouts; keep retries from hiding real regressions.
- **Results and triage.** Save enough output to distinguish a product bug, a test defect, a model/agent failure, and an unavailable test environment. Decide who will maintain prompts, locators, browser setup, and fixtures.
- **Cost controls.** Track model usage, browser time, CI minutes, and engineering time. A low-cost package can still have a high operating cost if the team must build and maintain its test infrastructure.

With a managed platform, some execution and reporting capabilities are supplied as product features, but you still own the acceptance criteria, test selection, secret handling, and response to failures.

## Costs and licenses are different questions

Prices below were checked against vendor sources on November 27, 2026; hosted plans and usage rates can change. A repository license is not a quote for model, browser, traffic, or engineering costs.

| Option | Repository license or plan fact | Usage to account for |
| --- | --- | --- |
| Stagehand | MIT license | Browserbase Free lists $0/month, one browser hour, and $5 in model tokens; Developer lists $20/month for 100 browser hours, then $0.12 per additional hour. Model Gateway usage is separate. Local browser and model-provider costs differ. |
| Browser Use | MIT license; the open-source harness and local Chrome are free | Browser Use Cloud lists hosted browsers at $0.06 per browser hour, with separate model/task rates. The local route still has model-provider and CI/browser setup costs. |
| Playwright MCP | Apache-2.0 license | The coding agent/model used while authoring is a separate cost; the PR job uses your Playwright browser and GitHub Actions minutes. |
| Momentic | Free lists $0/month with $50 of monthly usage and no card; Scale lists $500/month with $500 of usage | Test steps, AI-generated/failure-recovery steps, and hosted browser minutes have separate rates. Free runs pause when the balance reaches $0. Check current rates and recorded usage before estimating a monthly total. |

For any path, estimate the operating cost as:

> **Runs per month × (model/API usage + browser/runtime usage + CI minutes) + setup, maintenance, and triage time.**

Do not treat “open source,” a free plan, or included credits as unlimited execution. For a small pilot, run one flow, read the usage record, and include the time required to investigate any failure.

## GitHub Actions: wire the tool into a real test

The examples below trigger on pull requests and assume you already have a test for one safe staging flow. They are templates: use your project’s lockfile and runner command. The Stagehand and Browser Use examples call a project-owned test entry point because those libraries do not define the same turnkey PR runner. The Playwright MCP server is used by the coding agent before CI; the workflow runs the committed Playwright test.

### Stagehand

Stagehand v4’s TypeScript docs require Node.js 22.18 or later. For a hosted Browserbase session, store `BROWSERBASE_API_KEY` as a repository Actions secret and have your code read and pass it to `browserbase.launch()`. If you use a local browser with a provider model instead, configure the provider key in the code and workflow; Stagehand does not load environment variables on your behalf. The workflow below assumes `test:stagehand` is already defined in your project’s test runner.

If that runner launches Stagehand’s local browser in a headless Linux job, set `headless: true` and attach it with `Stagehand.create({ browser })` before using the Stagehand page/context API. The browser starts headed unless requested otherwise. This is separate from the hosted Browserbase route shown in the workflow.

`name: Stagehand smoke  on:  pull_request:  branches: [main]  jobs:  browser-smoke:  runs-on: ubuntu-latest  timeout-minutes: 15  env:  BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }}  steps:  - uses: actions/checkout@v6  - uses: actions/setup-node@v6  with:  node-version: "22.18"  cache: npm  - run: npm ci  - run: npm run test:stagehand`

Install Stagehand and a current, patched Zod v4 release if your test uses schema-based extraction; commit and audit the resulting lockfile. Make the one-flow test assert the expected page state. For Stagehand v4, keep the test runner separate: the SDK itself does not supply one.

### Browser Use

The example uses Browser Use 1.0 with a local Chromium browser and your own model-provider key. Pin the Browser Use version in your dependency file and lockfile; its documentation notes that releases move quickly. The test file should construct an agent with `Browser('chromium')`, then assert the observed result in your test runner rather than treating a final agent message alone as a pass.

`name: Browser Use smoke  on:  pull_request:  branches: [main]  jobs:  browser-smoke:  runs-on: ubuntu-latest  timeout-minutes: 15  env:  OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}  steps:  - uses: actions/checkout@v6  - uses: actions/setup-python@v5  with:  python-version: "3.12"  cache: pip  cache-dependency-path: requirements-ci.txt  - run: python -m pip install -r requirements-ci.txt  - run: browser-use install  - run: pytest -q tests/agent/test_one_flow.py`

Use a local browser only when that matches the workflow you want to measure. Browser Use 1.0’s default `Browser()` uses its hosted browser; if you choose that route, supply the documented Browser Use key and include hosted-browser usage in the estimate.

### Playwright MCP with a coding agent

For local authoring, the Playwright MCP project documents this standard server configuration:

`{  "mcpServers": {  "playwright": {  "command": "npx",  "args": ["@playwright/mcp@latest"]  }  } }`

The upstream example uses `@latest`; pin the server version in a project lockfile for repeatable team setups. For a headless shell or CI-like local session, pass the documented `--headless` option.

Use the coding agent to explore the flow or help draft a test, then review and commit a normal Playwright test. Do not make the MCP server the CI gate. Run the test file in GitHub Actions instead:

`name: Playwright smoke  on:  pull_request:  branches: [main]  jobs:  browser-smoke:  runs-on: ubuntu-latest  steps:  - uses: actions/checkout@v6  - uses: actions/setup-node@v6  with:  node-version: lts/*  cache: npm  - run: npm ci  - run: npx playwright install --with-deps chromium  - run: npx playwright test tests/e2e/one-flow.spec.ts  - uses: actions/upload-artifact@v5  if: ${{ !cancelled() }}  with:  name: playwright-report  path: playwright-report/  retention-days: 30`

The test path should exist in your repo, and the Playwright config should enable the HTML report if you want to upload `playwright-report/`. The official CI guide uses this same install-and-run pattern and shows how to review the report and trace.

### Momentic

Momentic’s current web quickstart creates a repository-based YAML web test. To run the documented CI flow, commit `package.json` and `package-lock.json`, store an API key as the `MOMENTIC_API_KEY` repository secret, and use the GitHub Actions commands from the product guide:

`name: Momentic smoke  on:  pull_request:  types: [opened, synchronize]  jobs:  test:  runs-on: ubuntu-latest  timeout-minutes: 15  env:  MOMENTIC_API_KEY: ${{ secrets.MOMENTIC_API_KEY }}  steps:  - uses: actions/checkout@v4  with:  fetch-depth: 2  - uses: actions/setup-node@v4  with:  node-version: 22.12.0  cache: npm  - run: npm ci  - run: npx momentic install-browsers --all  - run: npx momentic run --output-dir test-results  - name: Upload results  if: always()  run: npx momentic results upload test-results`

This runs the Momentic tests configured in the repository. For a one-flow evaluation, keep the pilot project to one saved test or use the test-selection options documented in the [GitHub Actions guide](https://momentic.ai/docs/running-tests/ci/github-actions). The result-upload command makes run output available for review. The guide also describes using a small tagged set as a merge gate.

## Try one flow on one pull request

You can compare tools without turning the experiment into a large migration:

1. **Pick a safe staging journey.** Choose one browser flow with a disposable account and a visible final state, such as signing in and reaching a dashboard. Avoid real payments, destructive actions, and production data.
2. **Write the assertion before the prompt.** Record what must be true at the end, such as the expected heading and account identifier. This gives every tool the same pass condition.
3. **Choose the artifact and tool.** Use a repo test and a local runner for Stagehand or Browser Use; use Playwright MCP to help author a test that will run under Playwright Test; or use Momentic’s web quickstart to create a YAML test in the repo.
4. **Open a small PR.** Add only the test and its CI workflow. Trigger it on `pull_request`, use a same-repository branch, and keep the check non-blocking until it has behaved reliably. GitHub does not pass repository secrets to workflows from forked repositories, so do not weaken the workflow trigger to expose a secret to untrusted code.
5. **Review the evidence.** Record whether the final assertion passed, the job duration, model/browser usage, CI minutes, and time spent diagnosing any failure. Keep the run output, screenshots, or trace only in a trusted artifact store.
6. **Decide whether to keep it.** Make the check required only after the team can explain its failures and the maintenance owner is clear.

### A self-serve Momentic path

If you want to try the managed option on that same flow:

1. Open [Momentic pricing](https://momentic.ai/pricing), choose the **Free** plan, and select **Get started**. The current page lists $0/month, $50 of monthly usage, and no card requirement.
2. In the repository, use the [Web quickstart](https://momentic.ai/docs/quickstart/web) to set up the project and create a single YAML test for the staging flow. The quickstart uses the Momentic wizard and asks you to set the app URL, describe the flow, add an action, and assert the resulting page. Keep the test's expected outcome explicit.
3. Create an API key in the [Momentic dashboard](https://app.momentic.ai/settings/api-keys) and store it as the GitHub secret `MOMENTIC_API_KEY`. Do not commit or print the key.
4. Add the workflow above to the PR. Review the run result and usage in Momentic and GitHub Actions before deciding whether to keep the check.

A Free plan includes usage, not unlimited hosted execution. The pricing page currently lists per-step and hosted-runtime rates and says runs pause when the included balance is depleted. If the workflow runs against a forked PR, the secret will be unavailable; use a trusted same-repository pilot instead.

## What these examples actually exercised

All browser flows used a disposable local sign-in page with synthetic values. No customer data or model simulation was used. These results separate local browser checks from agent behavior and hosted execution.

| Path | Local result | Not established |
| --- | --- | --- |
| Playwright Test | The synthetic sign-in flow passed in real local Chromium; a deliberately wrong heading failed. | A GitHub-hosted run |
| Stagehand | The local page API flow passed with direct locators; a deliberately wrong heading failed. | No act(), observe(), extract(), model call, or Browserbase session was used. |
| Playwright MCP | The local stdio server completed the flow and returned the expected accessibility snapshot; a deliberately wrong assertion was caught. | No coding-agent model or GitHub-hosted workflow was involved. |
| Browser Use | The Python local CLI-helper flow completed; a deliberately wrong expectation failed. | No Agent or model call ran; this validates helpers, not Agent behavior. |
| Momentic CLI | No-auth --help and local install-browsers chromium completed. | Setup only: no authenticated test, account action, or service execution. |
| GitHub Actions | Not run on hosted runners. | All hosted Actions examples remain untested. |

## Which option should you choose?

- **Keep Playwright Test as the gate** when you already have stable browser tests and exact assertions. Use Playwright MCP as an authoring aid if it fits your coding-agent workflow, but review the code it produces.
- **Choose Stagehand** when you want an open-source SDK that combines direct browser operations with higher-level actions, and your team is prepared to own the test runner and CI plumbing.
- **Choose Browser Use** when you want a Python-first agent loop and can decide whether the browser and model run locally or through Browser Use’s hosted services. Verify the final application state independently.
- **Evaluate Momentic** when you want repository YAML tests plus managed test authoring and CI integration. Check the current usage rates and keep one flow small while you learn the runtime and reporting behavior.
- **For unit or API test generation**, evaluate tools on those artifacts directly. A browser workflow comparison cannot answer which tool is best for code-level or API-case generation.

## Further reading

- [Momentic: Mo](https://momentic.ai/mo)
- [Momentic pricing](https://momentic.ai/pricing)
- [Momentic vs. Stagehand](https://momentic.ai/comparison/momentic-vs-stagehand)
- [Momentic vs. building your own](https://momentic.ai/comparison/momentic-vs-build-your-own)
- [Momentic vs. Playwright MCP](https://momentic.ai/comparison/momentic-vs-playwright-mcp)
- [Momentic GitHub Actions](https://momentic.ai/docs/running-tests/ci/github-actions)
- [Stagehand installation](https://docs.stagehand.dev/v4/first-steps/installation) and [license](https://github.com/browserbase/stagehand/blob/main/LICENSE)
- [Stagehand v4 migration notes](https://docs.stagehand.dev/v4/migrations/playwright)
- [Browser Use 1.0 quickstart](https://docs.browser-use.com/open-source/quickstart), [license](https://github.com/browser-use/browser-use/blob/main/LICENSE), and [pricing](https://browser-use.com/pricing)
- [Playwright MCP README](https://github.com/microsoft/playwright-mcp) and [license](https://github.com/microsoft/playwright-mcp/blob/main/LICENSE)
- [Playwright CI guide](https://playwright.dev/docs/ci-intro)
- [Playwright test assertions](https://playwright.dev/docs/writing-tests)

## Keep reading.

[Engineering   QA Bench: Evaluating QA Agents on Real Web Applications     QA Bench measures how many real bugs a QA agent finds in a running web application within a fixed amount of time, and how many of the bugs it reports are real.     Wei-Wei Wu     25 min read](/blog/qa-bench)[Engineering   Axing our Custom Harness for AI SDK: Tool-based Agents for E2E Testing     From brittle browser scripts to self-healing AI agents: how we rebuilt AI Action to discover, replay, and repair end-to-end test flows without rewriting test code.     Zach Bellay     10 min read](/blog/tool-based-agents-for-e2e-testing)[Engineering   How We Ditched Postgres for ClickHouse to Process 12 Billion Caches Per Day     From Postgres pain to ClickHouse speed: how we re-architected caching to serve 2M+ cache queries and 20B entries per day, while maintaining ~250ms average resolution latency.     Henry Haefliger     6 min read](/blog/postgres-to-clickhouse-migration)

## Try Mo on your app.

Mo is an AI QA engineer. It tests your running app and files each bug with repro steps. Free to start, no credit card.

[Try for free](https://app.momentic.ai/signup) [Contact sales](/sales)
