{
 "schema": "aiblocks-page/1",
 "id": "agency-testing-test-automation-engineer",
 "type": "agent",
 "name": "Test automation engineer agent",
 "summary": "Get stable Playwright or Cypress browser tests, a CI setup and a fix for each flaky test, so failures mean real bugs and not bad timing.",
 "headline": "Test automation engineer agent",
 "subhead": "Name the flows that must never break, and paste your tests and a failing run if you have them. The agent picks which flows need browser tests, writes steady Playwright or Cypress code and sets up CI. You get a root cause and a fix for each flaky test.",
 "job": {
  "id": "test-and-fix-code",
  "name": "Test and fix code"
 },
 "level": "intermediate",
 "thinking": "high",
 "tested": true,
 "updated": "2026-11-03",
 "first_published": "2026-10-26",
 "inputs": [
  {
   "type": "question",
   "required": true,
   "label": "Question",
   "what": "the problem, decision or piece of work you want help with, and what a good outcome looks like"
  },
  {
   "type": "codebase",
   "required": false,
   "label": "Codebase",
   "what": "a project's code, in a folder or repo the AI can open"
  }
 ],
 "outputs": [
  {
   "type": "plan",
   "required": true,
   "label": "Plan",
   "what": "a dated plan: what to do, in what order, with a decision rule for each step"
  },
  {
   "type": "code_change",
   "required": true,
   "label": "Code change",
   "what": "a change to the code, with what it fixes and how it was checked"
  }
 ],
 "you_give": [
  "The flows that must never break, in plain words, such as \"a customer adds a product and pays\".",
  "The tool you use or want, Playwright or Cypress, and your language, such as TypeScript.",
  "Your existing test files and CI config, pasted or uploaded (optional).",
  "The failing or flaky tests, with the error text, the CI log or a trace (optional).",
  "How test data is made today, such as an API, a seed script or by hand (optional)."
 ],
 "you_get": [
  "A short list of flows worth a browser test, and which checks to move to unit or API tests.",
  "Test code with role-based selectors, data set up through the API and no hard waits.",
  "The base files, such as a login fixture, data helpers and a Playwright config that keeps traces.",
  "A CI file that splits tests across machines and keeps traces when a test fails.",
  "A flake table with the cause and the fix for each flaky test you shared.",
  "A checklist to run each new test ten times before you merge it."
 ],
 "use_when": [
  "Your browser tests fail at random, and your team re-runs them until they go green.",
  "You have no end-to-end tests for sign-up or checkout and want a first set that you can trust.",
  "Your test suite takes too long in CI and you want it split across machines.",
  "You are moving from Cypress to Playwright, or the other way, and want the tests moved with care."
 ],
 "skip_when": [
  "You have a finished test run and want it sorted by cause and risk: use the Test results analyst.",
  "You want a page-by-page check with screenshots and no code: use the Visual QA evidence collector.",
  "You only need to test an API, not a browser: use the API test planner.",
  "You want an accessibility audit: use the Accessibility auditor.",
  "You do not use Playwright or Cypress, such as Selenium or a mobile app test tool: this agent may not fit."
 ],
 "output_sample": {
  "input": [
   "The flows that must never break, in plain words",
   "Your tool and language (Playwright or Cypress)",
   "Your test files and CI config (optional)",
   "Failing or flaky tests with error text or logs (optional)"
  ],
  "prerequisites": [
   "A project with Playwright or Cypress installed, or permission to add it",
   "A way to run the tests yourself, or Claude Code or Codex to run them"
  ],
  "output": [
   {
    "name": "Scope",
    "contains": "The flows that deserve a browser test and the checks that move to unit or API tests."
   },
   {
    "name": "Setup files",
    "contains": "Data helpers, a once-per-worker login and a config that keeps traces for failures."
   },
   {
    "name": "Tests",
    "contains": "Test code per flow with role-based selectors, owned data and no hard waits."
   },
   {
    "name": "CI",
    "contains": "A workflow file that splits tests, keeps failure files and blocks a merge on a failure."
   },
   {
    "name": "Flake triage",
    "contains": "Each flaky test with its symptom, likely cause and fix."
   },
   {
    "name": "Run checklist",
    "contains": "The commands to repeat each test ten times and a list of what has not been run."
   }
  ]
 },
 "output_shape": "SCOPE\n  Flow <name> | Browser test or lower level | Why <reason>\n\nSETUP FILES\n  <data helpers, login fixture, config> | <code>\n\nTESTS\n  <test file name> | <what it proves> | <code>\n\nCI\n  <workflow file> | Shards <number> | Artifacts kept <trace, screenshot, video>\n\nFLAKE TRIAGE\n  <test> | Symptom <what fails> | Cause <likely cause> | Fix <change>\n\nRUN CHECKLIST\n  Command <command> | Runs <10> | Result <you fill in> | NOT RUN <list>",
 "how_to_use": [
  "Download the pack. Add it to your AI as a skill, or paste SKILL.md and then references/source-agent.md into a new chat.",
  "Say which tool and language you use, and list the flows that matter. For flaky tests, paste the test, the error text and the CI log.",
  "Ask for the plan first: List the flows that need browser tests and what moves to unit or API tests. Do not write code yet.",
  "Approve the list. Then ask for the base files first (data helpers, login fixture, config) and the tests second.",
  "Run the tests yourself. For each new test, run it ten times, for example with npx playwright test --repeat-each=10. Claude Code or Codex can run it for you if you allow it.",
  "Paste any failure and its trace back and ask for the cause. Do not merge a test that needs a retry to pass."
 ],
 "checks": [
  "The result addresses your actual task and cites the evidence used.",
  "Examples, role-play experience and targets are kept separate from verified results.",
  "Claims of tests, memory, tool access or completed actions match what actually happened."
 ],
 "next": [
  {
   "name": "Code reviewer agent",
   "url": "https://useaiblocks.com/skills/agency-engineering-code-reviewer",
   "why": "Code reviewer agent"
  }
 ],
 "source": {
  "by": "Michael Sitarzewski and Agency Agents contributors",
  "repo": "msitarzewski/agency-agents",
  "url": "https://github.com/msitarzewski/agency-agents/blob/b37b5bb33b78f2c1d6567d98e25ca818e3259219/testing/testing-test-automation-engineer.md",
  "licence": "MIT",
  "original_name": "Test Automation Engineer",
  "commit": "b37b5bb33b78f2c1d6567d98e25ca818e3259219"
 },
 "credits": [
  {
   "title": "Test Automation Engineer",
   "by": "Michael Sitarzewski and Agency Agents contributors",
   "url": "https://github.com/msitarzewski/agency-agents/blob/b37b5bb33b78f2c1d6567d98e25ca818e3259219/testing/testing-test-automation-engineer.md",
   "used": "Original agent profile, preserved in references/source-agent.md; AI Blocks adds setup and review instructions."
  }
 ],
 "files": [
  "LICENSE",
  "references/source-agent.md",
  "SETUP.md",
  "source.json"
 ],
 "links": {
  "page": "https://useaiblocks.com/agents/agency-testing-test-automation-engineer",
  "markdown": "https://useaiblocks.com/agents/agency-testing-test-automation-engineer.md",
  "json": "https://useaiblocks.com/agents/agency-testing-test-automation-engineer.json",
  "instructions": "https://useaiblocks.com/skills/agency-testing-test-automation-engineer/SKILL.md",
  "download": "https://useaiblocks.com/skills/agency-testing-test-automation-engineer.zip",
  "api_item": "https://useaiblocks.com/api/v1/items/agency-testing-test-automation-engineer",
  "api_document": "https://useaiblocks.com/api/v1/documents/agent/agency-testing-test-automation-engineer",
  "mcp": "https://useaiblocks.com/mcp"
 }
}
