Verify a Playwright healer locator fix
Initialize Playwright Test Agents, run the healer on a renamed button, and verify the repaired test still fails when saving breaks.
A Playwright test clicks Save draft and waits for Draft saved, then starts timing out after a rename to Save note. The healer agent can update the locator. Keep the success assertion in view while you decide whether to accept its patch.
Give the generator a behavior to test
In a configured project with Playwright 1.56 or later and Claude Code, install Playwright’s agent definitions.
pnpm exec playwright init-agents --loop=claudeThe command writes the planner, generator and healer definitions under .claude/agents/. Start Claude Code in the project so it loads those files, and check the Playwright Test Agents guide for other agent loops.
Write a short plan in specs/ for the generator: open /draft, type a title, click save, and verify confirmation. Point the generator at that plan and a seed test like tests/seed.spec.ts so it starts from your app setup. Give the plan a concrete outcome to assert.
This test shows the expected locator after the rename. Set Playwright’s baseURL to your app and have the draft page render the confirmation in a status element.
import { expect, test } from '@playwright/test'
test('saves a draft note', async ({ page }) => {
await page.goto('/draft')
await page.getByRole('textbox', { name: 'Title' }).fill('Trip notes')
await page.getByRole('button', { name: 'Save note', exact: true }).click()
await expect(page.getByRole('status')).toHaveText('Draft saved')
})With the updated label and a working save handler, saves a draft note passes.
Review the repair against the failure
Give the healer the failing test name and ask it to replay the failure before editing. For an intentional rename, expect a diff that changes the button name from Save draft to Save note. The expect line should still require Draft saved.
Check the diff for a test.fixme() skip, a removed assertion, or a looser locator like the first button on the page. The healer’s instructions allow it to mark a test test.fixme() and explain the failure when it believes the app is broken. Inspect that failure against the app before accepting a skip.
Run the repaired file against the working app, then break the save handler in a throwaway check and rerun it. If the status element stays present but empty when you disable saving, the status assertion fails with Expected: "Draft saved" and Received: "". Accept the locator diff when the test passes on the working flow and fails when saving breaks.