Spike: Playwright Test Agents (Planner / Generator / Healer) #10661
Replies: 2 comments
Follow-up: Integration with our Agent SkillsI dug into what What gets generatedEach agent uses YAML frontmatter with The interesting integration angleOur
What a combined approach could look likeA merged healer agent that:
This would be taking their Practical concernThe Playwright MCP server runs a real browser — needs a display or headless Chromium. Works locally but adds complexity for automated/CI use. To experimentnpx playwright init-agents --loop=claude --config playwright.config.tsThen customize the generated |
Experiment: Codegen → Convention Transform PipelineTried combining Playwright codegen with an agent/skill to auto-rewrite into our conventions. PipelineWhat codegen produces (raw)import { test, expect } from '@playwright/test';
test('test', async ({ page }) => {
await page.goto('http://localhost:5173/');
await page.locator('canvas').dblclick({ position: { x: 500, y: 400 } });
await page.getByPlaceholder('Search Nodes...').fill('KSampler');
await page.getByPlaceholder('Search Nodes...').press('Enter');
await page.getByRole('button', { name: 'Queue' }).click();
await page.waitForTimeout(1000); // anti-pattern
});What a transform skill would produceimport {
comfyPageFixture as test,
comfyExpect as expect
} from '../fixtures/ComfyPage'
test.describe('Queue workflow with KSampler', { tag: ['@canvas'] }, () => {
test.afterEach(async ({ comfyPage }) => {
await comfyPage.canvasOps.resetView()
})
test('should add KSampler and queue', async ({ comfyPage }) => {
await comfyPage.canvas.dblclick({ position: { x: 500, y: 400 } })
await comfyPage.searchBox.fillAndSelectFirstNode('KSampler')
await comfyPage.nextFrame()
await comfyPage.menu.queueButton.click()
})
})Key transforms needed
VerdictUseful as onboarding tool, not a productivity win for experienced contributors.
The sweet spot: new contributor records a flow with codegen → pastes output → asks agent to rewrite using our conventions. This could be documented in the writing-playwright-tests skill as an alternative starting point. Experiment files in |
Uh oh!
There was an error while loading. Please reload this page.
TL;DR
Playwright v1.56+ ships three LLM-driven "agents" — Planner, Generator, and Healer — that can scaffold test plans, generate test files, and auto-repair failing tests. We evaluated them against our codebase. Recommendation: wait.
Feature Status
npx playwright init-agentsWhat Are They?
Three prompt templates + MCP tool definitions that guide an external LLM (VS Code Copilot, Claude Code, etc.) to interact with a live browser via Playwright MCP:
Key insight: These are not standalone CLI tools or CI automation. They require an interactive LLM session to operate.
Why Wait?
ComfyPage,ComfyMouse,VueNodeHelpers, and page objects. The generic agent prompts may produce incorrect patches.writing-playwright-testsskill and established patterns.When to Revisit
Full Evaluation
Detailed findings are in
temp/plans/playwright-agents-evaluation.md(local to the spike branch).Thoughts? Anyone tried these on a different project?
All reactions