by thetestingacademy
Teach agents to use AI browser agents for exploratory and smoke QA with step budgets, evidence-based assertions, guardrails, and Playwright conversion.
npx @qaskills/cli add browser-agent-qa-testingAuto-detects your AI agent and installs the skill. Works with Claude Code, Cursor, Copilot, and more.
You are an AI QA engineer who uses browser agents for bounded exploratory and smoke testing, gathers evidence for every claim, and converts stable findings into maintainable Playwright tests.
Create a small harness for browser-agent QA runs.
python -m venv .venv
. .venv/bin/activate
pip install browser-use playwright pydantic python-dotenv
playwright install chromium
npm install --save-dev @playwright/test
Store run configuration outside prompts.
qa-agent/
charters/
checkout-smoke.md
account-settings.md
evidence/
screenshots/
notes/
scripts/
run_browser_agent.py
tests/
e2e/
frozen-smoke.spec.ts
Every agent run needs a charter.
# Charter: Checkout Smoke
Goal: Verify a signed-in user can add one item to the cart and reach the payment step.
Environment: Staging
Account: Synthetic buyer
Step budget: 35
Allowed actions: Browse catalog, add item, open cart, start checkout
Forbidden actions: Submit real payment, change account email, delete saved addresses
Evidence required: Final URL, visible checkout heading, screenshot, console errors
Stop condition: Payment form is visible or a blocking bug is found
Keep the browser-agent task explicit and bounded.
# qa-agent/scripts/run_browser_agent.py
import asyncio
from browser_use import Agent
from dotenv import load_dotenv
load_dotenv()
TASK = """
You are testing the checkout smoke charter.
Use the staging site only.
Do not submit payment.
Stop after 35 browser actions.
For every assertion, mention the exact visible text, URL, or screenshot evidence.
If blocked, report the blocker and stop.
"""
async def main() -> None:
agent = Agent(task=TASK)
result = await agent.run(max_steps=35)
print(result)
if __name__ == "__main__":
asyncio.run(main())
Convert a stable exploratory path into deterministic automation.
// tests/e2e/checkout-smoke.spec.ts
import { expect, test } from '@playwright/test';
test('signed-in buyer can reach payment step', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Email').fill(process.env.SMOKE_USER || 'buyer@example.com');
await page.getByLabel('Password').fill(process.env.SMOKE_PASSWORD || 'change-me');
await page.getByRole('button', { name: 'Sign in' }).click();
await page.getByRole('link', { name: 'Catalog' }).click();
await page.getByRole('button', { name: /add to cart/i }).first().click();
await page.getByRole('link', { name: 'Cart' }).click();
await page.getByRole('button', { name: 'Checkout' }).click();
await expect(page).toHaveURL(/checkout/);
await expect(page.getByRole('heading', { name: /payment/i })).toBeVisible();
});
The browser agent report must include these fields.
Use guardrails to keep agent runs safe.
| Guardrail | Reason | Example |
|---|---|---|
| Step budget | Prevent wandering | Stop at 35 actions |
| Test account | Avoid customer data | Synthetic buyer |
| Forbidden actions | Prevent damage | Do not submit payment |
| Evidence rule | Reduce hallucination | Cite visible text |
| Freeze criteria | Create durable tests | Convert stable smoke path |
| Human review | Catch weak claims | Review notes before filing bugs |
- name: Install QA Skills
run: npx @qaskills/cli add browser-agent-qa-testing12 of 29 agents supported
Go from zero to Playwright pro: Page Object Model, fixtures, and CI/CD on real projects.
Use code PROMODE at checkout