
recording-browser-flow-as-test
Execute a user flow step-by-step in Cursor's built-in browser while documenting each action, then emit a Playwright test that replays the same flow using stable selectors derived from the accessibility tree.
- Installs
- 410
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/spencerpauly/awesome-cursor-skills --skill recording-browser-flow-as-test- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads recording-browser-flow-as-test automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Recording Browser Flow as Playwright Test
Use the browser MCP as a recorder: every navigation, click, fill, and keypress becomes a row in a script. The agent then translates that trace into a Playwright test file in the repo (or a snippet to paste into an existing spec).
This is Cursor-native because it combines browser_snapshot (refs + roles + names) with structured actions — not a separate recorder extension.
Prerequisites
- Target app reachable (e.g. dev server running); use
finding-dev-server-urlif needed. - Repo has or will have Playwright installed (
@playwright/test). If not, add it withadding-e2e-testsor the project’s standard setup.
Recording workflow
1. Define the flow
One sentence scope, e.g. “Log in, open Settings, toggle dark mode, save.”
2. For each step, in order
-
browser_snapshot— get the accessibility tree and element refs. -
Choose the smallest interaction:
browser_clickwith ref from snapshot (not coordinate clicks unless required).browser_fillorbrowser_typefor inputs.browser_select_optionfor selects.browser_navigatefor full URL changes.
-
Log the step in a structured list the main agent keeps:
- Step number
- Action verb (
navigate,click,fill,press,select) - Locator strategy for Playwright — prefer:
getByRole('button', { name: '...' })getByLabel('...')getByPlaceholder('...')getByTestId('...')if the app uses test IDs
- Value (for fills), URL (for navigates)
- Optional: short assertion (“expect URL to contain
/settings”)
-
After actions that change the DOM or navigate, take a new
browser_snapshotbefore the next interaction. -
If the flow must wait for async content, use
browser_wait_foror short incremental waits percursor-ide-browserguidance — then snapshot again.
3. Add assertions
From the final snapshot and URL, add at least:
expect(page).toHaveURL(...)or URL fragment check- One visible outcome: text, role, or test id
4. Generate Playwright output
Emit a test file, e.g. tests/recorded/<flow-name>.spec.ts, containing:
test.describeandtest('...', async ({ page }) => { ... })- Steps as
await page.goto(...),await page.getByRole(...).click(), etc. - No raw snapshot refs in the final file — they are session-specific.
5. Run and harden
npx playwright test tests/recorded/<flow-name>.spec.ts
Fix flakiness: prefer expect(locator).toBeVisible() before clicks, use toPass() retries for async lists, avoid arbitrary waitForTimeout except as last resort.
Tips
- Stable selectors: roles and accessible names beat CSS from devtools. Add
data-testidin app code if names are ambiguous. - Auth: if the flow needs login, use env vars for test credentials or Playwright
storageState— never commit secrets. - Parallel runs: ensure test data does not collide with other tests.
When not to use
- Flows that require manual 2FA, captchas, or email links — stop and ask the user for a test bypass or mock.
FAQ
What does the recording-browser-flow-as-test skill do?
Execute a user flow step-by-step in Cursor's built-in browser while documenting each action, then emit a Playwright test that replays the same flow using stable selectors derived from the accessibility tree.
How do I install recording-browser-flow-as-test?
Run npx skills add https://github.com/spencerpauly/awesome-cursor-skills --skill recording-browser-flow-as-test in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/recording-browser-flow-as-test/ (personal) or .claude/skills/recording-browser-flow-as-test/ (project).
Which AI agents can use recording-browser-flow-as-test?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is recording-browser-flow-as-test safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains recording-browser-flow-as-test?
It is published by spencerpauly in spencerpauly/awesome-cursor-skills. It has 410 recorded installs.
More from spencerpauly/awesome-cursor-skills
visual-qa-testing
spencerpauly/awesome-cursor-skills
Visually QA a web application by launching it in Cursor's built-in browser, taking screenshots, checking console errors, and auditing network requests. Use after making UI changes to verify they look correct.
auditing-security
spencerpauly/awesome-cursor-skills
Perform a systematic security audit of a codebase, checking for OWASP Top 10 vulnerabilities, secrets exposure, and insecure patterns.
responsive-testing
spencerpauly/awesome-cursor-skills
Open the app in Cursor's browser at multiple viewport sizes, screenshot each, and report any layout breakage.
suggesting-cursor-rules
spencerpauly/awesome-cursor-skills
When the user repeats the same correction or convention multiple times, suggest a Cursor rule to encode it permanently.
systematic-debugging
spencerpauly/awesome-cursor-skills
Structured debugging methodology — reproduce, isolate, hypothesize, verify. Covers git bisect, binary search, logging, and minimal reproduction.
grinding-until-pass
spencerpauly/awesome-cursor-skills
Keep iterating on code changes until the tests pass, the build succeeds, or linting is clean. Runs in a tight loop of fix → run → check → repeat. Use when you want the agent to autonomously grind through test failures or build errors.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work