/browser-test:authorfrom browser-test
Transforms vague user descriptions into structured E2E browser tests by performing an exploratory Playwright run, then documenting steps with selectors, wait patterns, and verification points.
Ships in browser-test. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Transforms a vague user description (e.g., "test the purchase flow") into a structured, precise E2E test case by performing an exploratory browser run, then documenting each step with selectors, wait patterns, and verification points.
Core principle: Run first, document second. You cannot write a reliable test from reading code alone - you must observe the actual browser behavior.
Do NOT use when:
browser-test:runner instead)browser-test:refiner instead).mcp.json)E2E_BASE_URL set to a reachable environment)tests/e2e/conventions.md and the relevant area conventions before starting/author PROJ-247135), the Atlassian Jira MCP server must be available to fetch test steps and acceptance criteriadigraph author_flow {
rankdir=TB;
"Read conventions" -> "Classify area";
"Classify area" -> "Read area conventions";
"Read area conventions" -> "Exploratory browser run";
"Exploratory browser run" -> "Confirm scenario scope";
"Confirm scenario scope" -> "Classify steps into hooks";
"Classify steps into hooks" -> "Document steps";
"Document steps" -> "Write test case file(s)";
"Write test case file(s)" -> "Hand off to browser-test:refiner";
}
Hook-aware authoring : Every test case the author produces MUST separate observations into three named markdown sections — ## Before Hook, ## Test Steps, ## After Hook. The compiler maps these 1:1 to Playwright test.beforeEach, the test() body wrapped in test.step() blocks, and registerTeardown / test.afterEach. Inline setup or cleanup mixed into ## Test Steps produces a malformed compiled spec.
Read tests/e2e/conventions.md (global) to understand session management, interaction patterns, wait strategies, and verification approach.
When the user invokes /author with one or more Jira issue keys:
getJiraIssue via the Atlassian Jira MCP for each supplied keyissuetype id 10006. If none of the keys is an XRay Test, warn and continue from the user description onlyIf no Jira key is provided, proceed from the user's feature description only and omit Jira metadata from the output file.
Determine which area the test belongs to using the Functional Areas table in global conventions:
Read tests/e2e/{area}/conventions.md for area-specific flows (e.g., Authentication login sequence, persona specific workflows).
Catalog reusable procedures: Before exploring, scan the area conventions for documented multi-step sequences (e.g., login flows, navigation patterns, dropdown interactions, admin panel access). Build a list of these — you will reference them by name in test steps rather than re-describing them. Also scan existing test cases in the area (tests/e2e/{area}/*.md) for repeated sub-flows that could be referenced.
Using the Playwright MCP tools, explore the target area systematically. Start with a fresh browser session (follow Session Management from global conventions).
Phase 1 — Reconnaissance:
Navigate to the target area. Use browser_snapshot and browser_take_screenshot to observe page structure, available controls, visual layout, and initial state. Note the full set of interactive elements before touching anything.
Phase 2 — Happy path exploration: Walk through the primary intended user flow end-to-end. For each step:
browser_snapshot to inspect the accessibility tree before interactingbrowser_click (with accessibility ref from snapshot), browser_type, browser_select_option to interactbrowser_take_screenshot at key pages for referencePhase 3 — Edge case probing: After the happy path, probe boundary conditions:
Phase 4 — State transition testing: Observe how the UI responds to state changes:
Phase 5 — Scenario identification: From your exploration, compile a list of distinct test-worthy scenarios. Each scenario should represent ONE verifiable user outcome (e.g., "successful purchase with single club", "error when email is invalid", "banner dismissal on return visit"). Prioritize user-critical paths over cosmetic details.
Present the identified scenarios to the user as a numbered list with one-sentence descriptions. Wait for confirmation before authoring. The user may narrow, expand, or reprioritize the list.
If only one scenario was identified (directed request like "test the login flow"), skip confirmation and proceed.
For each approved scenario, convert the relevant exploratory run observations into structured steps:
Classify every step into one of three hooks (the compiler emits each one differently — getting the boundary wrong produces a malformed .spec.ts):
| Hook | What belongs here | What does NOT belong here |
|---|---|---|
| Before Hook (Setup) | Login, env gates, captcha bypass, cookie injection, navigation to the starting state of the scenario, expanding/opening fixtures needed for every step. Must be deterministic on a clean session. | Anything the scenario is actually validating. If the test would still be meaningful with this step removed from coverage, it is setup — not a test step. |
| Test Steps (Scenario) | The actions and verifications under test. Each step represents a user-observable interaction or assertion that contributes to the pass condition. | Re-doing setup (re-login, re-navigating to the project). Cleanup. Restoring state. |
| After Hook (Teardown) | Idempotent cleanup that restores shared fixtures or removes resources the test created (delete project, restore row order, archive item, close extra tabs). Must be defensive — safe to run even if the test failed mid-way. | First-time creation of resources. Anything that mutates state the test depends on. Anything required for the test to start cleanly (that's Before Hook). |
Rules for hook classification:
For each scenario, create tests/e2e/{area}/{test-name}.md following this structure:
# {Test Title}
<!-- Jira: PROJ-XXXXXX -->
## Summary
One-sentence description of what this test validates.
## Preconditions
- **Standard {area} preconditions** (see area conventions)
- {Only list test-specific preconditions here: specific project/data, fixture files, special permissions}
- **Environments:** local, preview {add staging/production only if applicable — see Test Safety}
- **Markers:** @regression @positive {plus area-specific tags}
## Before Hook
### Setup 1. {Setup title}
{Setup action — reference convention procedures by name}.
**Verify:** {Sanity check that setup landed at the expected starting state}
### Setup N. ...
## Test Steps
### 1. {Step title}
{Action description — reference convention procedures by name, not inline}.
**Verify:** {Expected outcome}
### N. Verify {final condition}
**Pass condition:** {What constitutes a passing test}
**Jira metadata rules:**
- When a Jira XRay key is known (from `/author PROJ-XXXXXX` or user input), include a comment on the line immediately after the heading: `<!-- Jira: PROJ-XXXXXX -->`
- When multiple keys are supplied (e.g. a user story and an XRay test), embed **only the XRay Test key** (`issuetype` id `10006`). User story, epic, and task keys are reference context only and must not appear in the file.
- When no Jira ticket exists yet, omit the `<!-- Jira: ... -->` line entirely. Do **not** use `jira: TBD` unless the user explicitly says the ticket is pending.
- Do **not** add `<!-- status: compiled | ... -->` — that is written by `/compiler` after Playwright generation.
## After Hook
### Teardown 1. {Teardown title}
{Idempotent cleanup action — must be safe to run even if the test failed mid-way}.
### Teardown N. ...
If a section is empty for a given test, still include the heading with the body _None — {one-line reason}._ so the compiler can confirm the section was considered (not forgotten). Common reasons: read-only tests have no After Hook; tests using only standard area preconditions may have a minimal Before Hook referencing the convention.
DRY rules for step authoring:
Complete login (see area conventions: Authentication). Do NOT re-describe or inline the steps.E2E_BASE_URL, {AREA}_BASE_URL). Verify step text says "navigate to {ENV_VAR}", not "navigate to https://specific.domain.com".Before handing off, review each authored test case against these checks:
Standard {area} preconditions, not list them individually.## Before Hook, ## Test Steps, and ## After Hook headings all exist. Empty sections use the _None — {reason}._ placeholder. A test case missing any of the three sections is malformed.## Test Steps. Likewise no ## Test Steps action exists solely to "reset" state — those belong in After Hook.## Test Steps step (or its **Pass condition:** line) defines what passing means. After Hook never contains assertions about the scenario's outcome.If any check fails, fix the test case before proceeding. If a convention update is needed, make it first.
Tell the user the test case(s) are ready for refinement. List each authored file:
Authored test cases:
- tests/e2e/{area}/{test-1}.md — {one-sentence summary}
- tests/e2e/{area}/{test-2}.md — {one-sentence summary}
Next step: invoke `browser-test:refiner` on each test case to stabilize it.
After refinement: invoke `browser-test:compiler` to generate Playwright .spec.ts files.
page.waitForEvent('download') pattern and verify the file via download.path() or download.saveAs().browser_snapshot refs for all UI interactions (browser_click, browser_type, browser_select_option). Do not use browser_evaluate with document.querySelector or CSS selectors to interact with UI elements. Reserve browser_evaluate/browser_run_code for non-UI operations (clearing cookies/storage) or when the accessibility tree genuinely can't express what you need (visual state checks, third-party widgets without ARIA).browser_type directly on input refs — Playwright's fill() sets the value programmatically without pointer events, bypassing floating label overlays. No need for JS focus workarounds.**Verify:** after page transitions, not after every clickTEST_USER_1_EMAIL etc.E2E_BASE_URL: Never hardcode URLs - use the env var in navigation steps**Environments:** line in preconditions. Default to local, preview. Only add production if the test is strictly read-only (no form submissions, no checkouts, no data mutations). See global conventions: Test Safety.**Markers:** line in preconditions listing the Playwright tags the compiler should emit (e.g., @regression @positive @bom). At minimum: one phase tag (@smoke/@regression/@sanity), one polarity tag (@positive/@negative), and one area tag.## Test Steps block, is a classification bug.**Standard {area} preconditions** (see area conventions) and only list test-specific additions.{parameter} placeholders in conventions and pass the values from each test.option 'Category A' — see area conventions: Custom Dropdowns").What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub autodesk/claude-browser-test-skills --plugin browser-test4 skills in this plugin
/compilerUse when converting a refined markdown E2E test case into a standard Playwright .spec.ts file. Triggers on "compile this test", "convert to playwright", or "generate spec from markdown". Requires a stable markdown test case and a running dev server./refinerUse when an E2E test case exists but needs stabilization through repeated execution. Runs the test multiple times, identifies flaky steps, and updates the test case and conventions until deterministic./runnerUse when executing a stable E2E test case that has already been refined. Follows test steps exactly without deviation, reports pass/fail with evidence.Other plugins' skills for the same job