Skip to content
CodeKruPro

Planner, generator, healer: what each may change

36/99

Module · Agents in the browser: Playwright MCP and test agents

intermediate

about 25 min

What this lesson teaches

The idea

Playwright ships three test agents: a planner that writes test plans, a generator that turns plans into tests, and a healer that repairs failing tests.

Why a tester cares

Planning and generating are low risk. Healing changes existing tests, which is where a test can quietly stop testing, so a reviewer holds each agent to its role.

Words you will meet

Test agent:
an AI that does one testing job on its own, such as writing or fixing tests.
Healer:
the agent that edits failing tests until they pass, or marks them as broken.
fixme:
a Playwright marker for a test that is expected to fail until the app is fixed.

What you will do

  1. 1Read the three roles
  2. 2Judge each action
  3. 3Submit
Jump to practice

Playwright ships three test agents, set up with npx playwright init-agents for a coding assistant: a planner explores the app and writes a test plan in Markdown, a generator turns the plan into test files and checks its locators against the live page, and a healer runs failing tests and repairs them, or marks them test.fixme when it believes the app itself is broken.

Each agent has a job, and a reviewer's job is to hold them to it. Planning and generating new tests are low risk. Healing changes existing tests, and that is where a test can quietly stop testing.

  • Allowed: within the agent's job, with nothing a reviewer must check.
  • Needs review: could be right, but only a person who knows the product can say. A renamed button, a skipped test with a reason, a longer timeout.
  • Reject: makes a test pass by checking less, or breaks the team's written rules.

Your task

Judge the ten recorded actions. If you have a laptop with Node.js, you can also run npx playwright init-agents in a sample project to see the agents' files; that part is not graded.

Sign in to practise

The lesson is free to read. A free account lets you talk to the practice bots, run your code and save your score. You will come back to this lesson.

1

Label each one

Ten recorded agent actions

0 of 10 labelled

  1. 1A01 · PlannerExplored the cart and wrote specs/checkout-plan.md with nine scenarios, including coupon limits.
  2. 2A02 · GeneratorTurned the plan into tests/checkout.spec.ts, checking each locator against the live page as it went.
  3. 3A03 · HealerChanged getByRole('button', { name: 'Place order' }) to { name: 'Complete purchase' } after the button text changed.
  4. 4A04 · HealerChanged the expected confirmation total from "Total: Rs 539" to "Total: Rs 588" so the test passes.
  5. 5A05 · HealerMarked the coupon test test.fixme() with the note "SAVE10 total looks wrong in the app".
  6. 6A06 · HealerRaised the timeout on the order-total assertion from 5 to 60 seconds.
  7. 7A07 · GeneratorAdded page.waitForTimeout(3000) before every click "for stability".
  8. 8A08 · HealerReplaced toHaveText('Total: Rs 539') with toBeVisible() on the total.
  9. 9A09 · PlannerAdded a scenario for the expired OLD20 coupon, citing the spec.
  10. 10A10 · GeneratorStubbed /api/orders with page.route() in a confirmation test, though AGENTS.md forbids mocks.

How this is checked: Each row has a right label. At least 8 of 10 must match. For the full score, a harder check: a few key rows must all be right.

Core checks earn 50 points and the harder checks the other 50. You can submit as many times as you like.

About this lesson

Playwright planner, generator and healer agents: what each may change without review

AI Testing for QA EngineersIntermediateAgents in the browser: Playwright MCP and test agents

How it works

Playwright ships three test agents for coding assistants. The planner explores an app and writes a test plan in Markdown, the generator turns plans into test files and checks locators against the live page, and the healer runs failing tests and repairs them, or marks them as fixme when it believes the app is broken.

Planning and generating new tests are low risk. Healing changes existing tests, and that is where a test can quietly stop testing. A reviewer's job is to hold each agent to its role and route risky changes to a person.

About the assignment

Judge a list of actions by the three agents as allowed, needing review, or not allowed.

What you will do

  1. Read each agent's role before judging its actions.
  2. Allow actions inside the role that a reviewer need not check.
  3. Send changes to assertions or skipped tests to review, and refuse actions outside any role.

Common mistakes

  • Treating fixme as harmless

    Marking a test fixme stops it testing. That decision needs a person.

  • Distrusting the planner

    Writing a plan changes no test. It is the lowest-risk action of the three.

In a real test suite

Teams encode these rules in their instruction files and in CI: for example, failing a pull request that adds a fixme without a linked bug.

When a healer marks a test as broken because it thinks the app is wrong, treat that as a bug report with evidence attached. Someone should confirm the app bug and link it, or the skipped test should be restored the same day.