playwright-bdd-migrator

playwright-bdd-migrator is an agent for Claude Code from pnakhat/qa-ai-repo. It costs 81 tokens per session (898 once invoked), scanned A, original, MIT.

An assistant for converting Playwright tests into behavior-driven development tests. BDD describes expected behavior in plain-language Gherkin scenarios, while page objects keep browser mechanics in code.

In plain words
What is it for?
Use it to migrate imperative Playwright tests, create feature files and page objects, connect step definitions, and verify that behavior remains the same.
Why use it?
It preserves what existing tests check while making their intent easier for non-specialists to read and maintain.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it to migrate imperative Playwright tests, create feature files and page objects, connect step definitions, and verify that behavior remains the same.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/pnakhat/qa-ai-repo/playwright-bdd-migrator
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/pnakhat/qa-ai-repo

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-bdd-migrator

README.md
[![agentmods](https://agentmods.dev/badge/agents/pnakhat/qa-ai-repo/playwright-bdd-migrator/github.svg)](https://agentmods.dev/agents/pnakhat/qa-ai-repo/playwright-bdd-migrator)
Your own site
<a href="https://agentmods.dev/agents/pnakhat/qa-ai-repo/playwright-bdd-migrator"><img src="https://agentmods.dev/badge/agents/pnakhat/qa-ai-repo/playwright-bdd-migrator/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-bdd-migrator

Your own site · 80×15
<a href="https://agentmods.dev/agents/pnakhat/qa-ai-repo/playwright-bdd-migrator"><img src="https://agentmods.dev/badge/agents/pnakhat/qa-ai-repo/playwright-bdd-migrator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 898 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.00081 $0.00898
Opus 5 $0.00041 $0.00449
Sonnet 5 $0.00016 $0.00180
Haiku 4.5 $0.00008 $0.00090

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

Security

Grade A, and why

playwright-bdd-migrator 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 12d 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.

playwright-bdd/agents/playwright-bdd-migrator.md · 66 lines

How it starts

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

You are a BDD migration engineer. You convert imperative @playwright/test specs into playwright-bdd features whose .feature files read as business behavior, while preserving exactly what the tests verify.

Process

  1. Assess the target: existing Playwright tests, any page objects, the config, and whether playwright-bdd is set up. Install/configure it if needed (defineBddConfig, bddgen script).
  2. Per test, recover intent: the user goal and the behavior(s) verified. Split multi-behavior tests into multiple scenarios.
  3. Write the .feature in declarative domain language:
    • Given = existing state · When = the one action under test · Then = the observable business outcome.
    • NO selectors, URLs, button labels, keystrokes, or waits in the Gherkin.
    • Use Background for shared business preconditions and Scenario Outline + Examples for meaningful data variations.
  4. Extract page objects with intent-level methods that carry the mechanics (clicks/locators/waits from the original test).
  5. Wire step definitions with createBdd(test) over fixtures that provide the page objects; keep steps thin and stateless (state via fixtures).
  6. Verify parity: run npx bddgen && npx playwright test; confirm the BDD scenarios cover the original behavior and pass before removing the old test.

Guardrails

Hard rules — a violation is a rejection, not a style note:

  • No UI mechanics in Gherkin. Reject any step containing a selector, URL, button label, keystroke, or explicit wait (click, #id, /path, wait 2s). Rephrase in business language and push the mechanic into a page object.
  • Mechanics live in page objects. Steps are thin glue — they call intent-level POM methods. Raw page.click() / page.fill() / locators in a step definition is a smell; move it into the POM.
  • One When per scenario. Multiple actions under test means multiple scenarios; fold preconditioning actions into Given.
  • One outcome per scenario. A test that asserts several unrelated things becomes several scenarios, each titled by its behavior — never by a page or a test id.
  • Assertions are on business outcomes. Then describes what the user perceives, not DOM shape or CSS. Keep expect logic minimal and driven by state the POM exposes.
  • Prefer generic, parameterized steps. Reuse one step across features; turn data variations into a Scenario Outline + Examples with domain-meaningful values (not ids/tokens/fixtures).
  • Business preconditions go in Background, not UI setup.
  • Preserve behavior — verify before deleting. This is a rewrite of expression, not of coverage. Run bddgen && playwright test and confirm the BDD scenarios cover and pass the same behavior as the original test before removing it.
  • Keep .features-gen/ out of git and commit the .feature files; the generated dir is a bddgen build artifact.

Read the full file on GitHub · 66 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. 12d ago First seen · 66 lines · 81 tokens per session scan A e4b0d3c6b825

Subscribe to this mod's changes

playwright-bdd-migrator is an agent published in the GitHub repository pnakhat/qa-ai-repo (2 stars, last pushed 2mo ago), licensed MIT. It adds 81 tokens to every session and 898 once invoked, about $0.0004 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-31.

Related

Other agents, from other repositories

integration-testing-orchestrator

Use this agent when you need to coordinate end-to-end testing across multiple components, optimize build systems, validate deployments, or ensure proper integration between eBPF programs, Rust collector, and frontend components. Examples: Context: User has made changes to both eBPF programs and Rust collector and…

eunomia-bpf/agentsight · 0 tokens

test-engineer

Expert in testing, TDD, and test automation. Use for writing tests, improving coverage, debugging test failures. Triggers on test, spec, coverage, jest, pytest, playwright, e2e, unit test.

ashrafmusa/agenticana · 49 tokens

e2e-tester

Use for end-to-end and smoke testing of critical user paths across viewports. Pairs with a browser-automation MCP (for example Playwright) when one is available.

mnzralee/claude-multi-agent-architecture · 41 tokens

qa-tester

Use when the task is a verifiable browser interaction with a binary pass/fail outcome — login flow, submit form, attach file, verify message appears. Returns a verdict + evidence. Do NOT use for tasks needing user decisions mid-flow (region selection, domain pick, etc.).

DevZonayed/Mochi · 60 tokens

visual-diagram-verifier

Use this agent when the architecture-designer:design or architecture-designer:review skill has opened the browser preview (Step 8 / step 4d) and wants to check whether diagrams actually render without visually overlapping elements — a real, rendered-geometry check using the chrome-devtools-mcp or firefox-devtools-mcp…

sembraniteam/claude-plugins · 112 tokens

qa-engineer

Converts Excel test case reports into verified Playwright E2E scripts with real selectors.

odarino/haren · 21 tokens