/browser-test:refinerfrom browser-test
Stabilizes flaky E2E tests by running them repeatedly, identifying failure patterns, and updating test cases and conventions until deterministic.
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.
Takes a structured test case and makes it deterministic by running it repeatedly, identifying failure patterns, and refining both the test case and shared conventions. Stops when N consecutive runs pass without the runner deviating from the documented steps.
Core principle: A test isn't done until it passes N times in a row with identical execution. Every workaround discovered belongs in the test case or conventions, not in the runner's head.
browser-test:author)Do NOT use when:
browser-test:author first)browser-test:runner)tests/e2e/{area}/.mcp.json)E2E_BASE_URL set to a reachable environment)digraph refiner_flow {
rankdir=TB;
"Read test case + conventions" -> "Execute test (fresh session)";
"Execute test (fresh session)" -> "Pass?" [label="run"];
"Pass?" -> "Analyze failure" [label="no"];
"Analyze failure" -> "Update test or conventions" [label="pattern identified"];
"Update test or conventions" -> "Execute test (fresh session)" [label="reset counter"];
"Pass?" -> "N consecutive passes?" [label="yes"];
"N consecutive passes?" -> "Execute test (fresh session)" [label="no, keep going"];
"N consecutive passes?" -> "Done - test is stable" [label="yes"];
}
Read the test case file, global conventions, and area conventions. Understand every step before running.
Check the test's Environments line against E2E_ENVIRONMENT (default: local). If the current environment is not listed, refuse to execute. Use E2E_BASE_URL (default: http://localhost:5173) wherever the test references it.
Validate the three-hook structure . The test case MUST contain three top-level sections: ## Before Hook, ## Test Steps, ## After Hook. If any section is missing, stop and report — this is a hand-off bug from the author skill, not a refinement issue. Empty sections are allowed only when the markdown uses the explicit _None — {reason}._ placeholder body. Fixing missing sections is an author-skill responsibility, not a refiner-skill responsibility.
Follow the Session Management procedure from global conventions:
browser_close)E2E_BASE_URL - this starts a fresh browser instanceFollow the test case steps in hook order: ## Before Hook → ## Test Steps → ## After Hook. Do not improvise or add steps not in the document. If you must deviate, that's a signal the test case needs updating.
After Hook is mandatory and runs even if Test Steps fails. Treat the execution as a try/finally: if any Test Step fails, capture the failure evidence, then still run every step in ## After Hook so the next refinement run starts from a clean state. Record any After Hook failures separately (a teardown failure does not mask a test step failure).
When a step fails:
When the test passes, increment the consecutive pass counter. Continue running until reaching N consecutive passes (default: 5).
When done, report:
| Symptom | Likely Fix | Where to Document |
|---|---|---|
| Click does nothing | Add await_element before click | Global conventions (Interaction Patterns) |
| Input gets wrong value | Add click-to-focus before type | Global conventions (Interaction Patterns) |
| Element obscured by overlay | Add conditional dismiss step | Area conventions or test case |
| Redirect loses context | Use time-based wait + snapshot check | Global conventions (Wait Patterns) |
| Stale selector after navigation | Wait for landmark on target page | Test case step |
| Pre-populated data unexpected | Document in test preconditions | Test case preconditions |
| Step times out at 15s/30s/60s+ | Switch to smartWaitFor(locator) from playwright-tests/utils/timeouts.ts — retry-aware cap (2/3/4 min for attempt 0/1/2+) with networkidle fail-fast. Use { timeout: currentTimeout() } for native Playwright assertions. | Compiled spec; do NOT add a new fixed timeout. |
| Lazy/virtualised section never visible | Use smartScrollIntoView(locator) (re-issues scroll until target paints). | Compiled spec. |
Whole test exceeds test.setTimeout because one wait consumed the budget | Bump test.setTimeout to at least 360000 (≥1.5× retry-2 cap). Never set the test budget equal to or below currentTimeout(). | Compiled spec. |
## Before Hook / ## Test Steps / ## After Hook sections; the compiler relies on those boundaries to emit test.beforeEach / test.step / registerTeardown. If refinement uncovers a step in the wrong section, treat that as a legitimate fix and move it — don't accept a misclassified test as stable.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
/authorUse when writing a new E2E browser test from a vague user description or feature requirement. Turns exploratory browser sessions into structured, reusable test cases./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./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