playwright-test-generator

playwright-test-generator is an agent for Claude Code from vasu31dev/playwright-ts-lib. It costs 158 tokens per session (2,061 once invoked), scanned A, original, MIT.

An agent for creating Playwright browser tests, which check a web application by controlling a real browser from end to end.

In plain words
What is it for?
Use it to create tests for features such as login or shopping carts, add tests to existing suites, and use existing page objects when available.
Why use it?
It helps locate the right test files and follow the project's existing structure, reducing guesswork when adding coverage.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to create tests for features such as login or shopping carts, add tests to existing suites, and use existing page objects when available.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/vasu31dev/playwright-ts-lib/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/vasu31dev/playwright-ts-lib

Made for: Claude Code.

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/vasu31dev/playwright-ts-lib/playwright-test-generator/github.svg)](https://agentmods.dev/agents/vasu31dev/playwright-ts-lib/playwright-test-generator)
Your own site
<a href="https://agentmods.dev/agents/vasu31dev/playwright-ts-lib/playwright-test-generator"><img src="https://agentmods.dev/badge/agents/vasu31dev/playwright-ts-lib/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/vasu31dev/playwright-ts-lib/playwright-test-generator"><img src="https://agentmods.dev/badge/agents/vasu31dev/playwright-ts-lib/playwright-test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 158 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,061 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.00158 $0.02061
Opus 5.5 $0.00063 $0.00824
Sonnet 5.5 $0.00032 $0.00412
Haiku 4.5 $0.00016 $0.00206

Measured 2mo ago against content hash 7fe98ec1bf4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.

templates/agents/playwright-test-generator.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 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 use the vasu-playwright-utils library for simplified, maintainable test code.

File Discovery

When the user does not specify a file path, find the right file before generating code:

  1. Search for existing tests matching the user's context:
    • Glob for tests/specs/**/*.spec.ts and scan filenames/describe blocks for keywords from the user's request (app name, feature like "login", "cart", URL domain)
    • Glob for tests/pages/**/*-page.ts to find related page objects
    • Glob for specs/**/*.md to find related test plans
  2. If adding to an existing test file: add the new test inside the existing test.describe block
  3. If creating a new test file: follow the existing naming convention:
    • File: tests/specs/{app}-{feature}.spec.ts (kebab-case, match existing patterns)
    • If page objects exist for the app, import them with @pages/{app}/ aliases
    • If no page objects exist, use vasu-playwright-utils functions directly
  4. If the context is ambiguous, list the candidate files and ask the user which one to use

Browser Interaction

Use playwright-cli bash commands for all browser interactions:

  • playwright-cli open <url> - Open browser and navigate
  • playwright-cli snapshot - View page structure and element refs
  • playwright-cli click <ref> - Click an element
  • playwright-cli fill <ref> "value" - Fill an input
  • playwright-cli type "text" - Type text
  • playwright-cli press Enter - Press a key
  • playwright-cli select <ref> "value" - Select dropdown option
  • playwright-cli check <ref> / playwright-cli uncheck <ref> - Toggle checkboxes
  • playwright-cli hover <ref> - Hover over element
  • playwright-cli goto <url> - Navigate to URL
  • playwright-cli go-back - Go back
  • playwright-cli console - View console messages
  • playwright-cli network - View network requests
  • playwright-cli close - Close browser

Read the full file on GitHub · 185 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. 2mo ago First seen · 185 lines · 158 tokens per session scan A 7fe98ec1bf4f

Subscribe to this mod's changes

playwright-test-generator is an agent published in the GitHub repository vasu31dev/playwright-ts-lib (25 stars, last pushed 7mo ago), licensed MIT. It adds 158 tokens to every session and 2,061 once invoked, about $0.0006 per session on Opus 5.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.

Related

playwright-test-generator compared with agents from other repositories

playwright-test-generator next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
playwright-test-generatorvasu31dev/playwright-ts-libAgent257mo agoMITA158Claude Code
browser-tester-v2lipas-liikuntapaikat/lipasAgent794d agoMITA69Claude Code
qa-testerdatit309/supergraphAgent238d agoMITA41Claude Code
qa-testercskwork/oh-my-symphonyAgent3910d agoApache-2.0A49Claude Code
visual-testerHazAT/pi-interactive-subagentsAgent7265mo agoMITA28Claude Code
e2e-testermnzralee/claude-multi-agent-architectureAgent81mo agoMITA41Claude Code
visual-verifierMineru98/imagineAgent422d agoMITA113Claude Code