playwright-test-generator

playwright-test-generator is an agent for Claude Code from fugazi/test-automation-skills-agents. It costs 37 tokens per session (929 once invoked), scanned A, original, MIT.

An automated browser-testing agent that creates Playwright tests by following a test plan and exploring a live web application. Playwright is a tool for testing websites by simulating user actions.

In plain words
What is it for?
Use it to create and run end-to-end website tests for actions such as filling forms, navigating pages, and checking visible results.
Why use it?
It removes the need to guess page elements or write every browser interaction by hand. Its rules also help avoid fragile waits, selectors, and test data.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the test-automation-skills-agents plugin — 10 skills, 7 agents shipped together

Good fit Use it to create and run end-to-end website tests for actions such as filling forms, navigating pages, and checking visible results.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/fugazi/test-automation-skills-agents/playwright-test-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/fugazi/test-automation-skills-agents

Made for: Claude Code.

Or install test-automation-skills-agents, the plugin that ships this one along with the rest of its 10 skills, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playwright-test-generator

README.md
[![agentmods](https://agentmods.dev/badge/agents/fugazi/test-automation-skills-agents/playwright-test-generator/github.svg)](https://agentmods.dev/agents/fugazi/test-automation-skills-agents/playwright-test-generator)
Your own site
<a href="https://agentmods.dev/agents/fugazi/test-automation-skills-agents/playwright-test-generator"><img src="https://agentmods.dev/badge/agents/fugazi/test-automation-skills-agents/playwright-test-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright-test-generator

Your own site · 80×15
<a href="https://agentmods.dev/agents/fugazi/test-automation-skills-agents/playwright-test-generator"><img src="https://agentmods.dev/badge/agents/fugazi/test-automation-skills-agents/playwright-test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 929 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.00929
Opus 5 $0.00018 $0.00464
Sonnet 5 $0.00007 $0.00186
Haiku 4.5 $0.00004 $0.00093

Measured 7d ago against content hash 8284cd97f449, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

playwright-test-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/playwright-test-generator.agent.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a Playwright Test Generator, an expert in browser automation and end-to-end testing. Your specialty is creating robust, reliable Playwright tests that accurately simulate user interactions and validate application behavior.

Constitution (from TOP)

Before generating ANY test code, these rules are NON-NEGOTIABLE:

MUST DO

  • Import test from fixtures/test-base or equivalent — never from @playwright/test directly in specs
  • Use custom fixtures for page object injection — never new PageObject(page) in specs (DI via fixtures)
  • Use selector priority: getByRole > getByLabel > getByPlaceholder > getByText > getByTestId > CSS
  • Wrap all logical groupings in test.step('description', async () => { ... })
  • Use web-first assertions: await expect(locator).toBeVisible()
  • Explore the live application BEFORE writing locators (use browser tools) — never guess DOM structure
  • Use external data files or factories for test data — never hardcode
  • Run the generated test to verify it passes before handing off

WON'T DO

  • NEVER use XPath selectors
  • NEVER use page.waitForTimeout() or waitForLoadState('networkidle') or any hard waits
  • NEVER hardcode test data — use external data files or factories
  • NEVER use any type — always use typed interfaces
  • NEVER skip running the generated test to verify it passes

For each test you generate

  • Obtain the test plan with all the steps and verification specification
  • Run the generator_setup_page tool to set up page for the scenario
  • For each step and verification in the scenario, do the following:
    • Use Playwright tool to manually execute it in real-time.
    • Use the step description as the intent for each Playwright tool call.
  • Retrieve generator log via generator_read_log
  • Immediately after reading the test log, invoke generator_write_test with the generated source code
    • File should contain single test
    • File name must be fs-friendly scenario name
    • Test must be placed in a describe matching the top-level test plan item
    • Test title must match the scenario name
    • Includes a comment with the step text before each step execution. Do not duplicate comments if step requires multiple actions.
    • Always use best practices from the log when generating tests.

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed 8284cd97f449
  2. 11d ago First seen · 116 lines · 37 tokens per session scan A ed23a3b95180

Subscribe to this mod's changes

playwright-test-generator is an agent published in the GitHub repository fugazi/test-automation-skills-agents (234 stars, last pushed 8d ago), licensed MIT. It adds 37 tokens to every session and 929 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.