with one click
test-flow
// Use when locking down user paths as E2E regression tests. Explores UI in browser, proposes flows, writes Playwright/Cypress tests, runs until green. Triggers: test flow, test journey.
// Use when locking down user paths as E2E regression tests. Explores UI in browser, proposes flows, writes Playwright/Cypress tests, runs until green. Triggers: test flow, test journey.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | test-flow |
| description | Use when locking down user paths as E2E regression tests. Explores UI in browser, proposes flows, writes Playwright/Cypress tests, runs until green. Triggers: test flow, test journey. |
| disable-model-invocation | true |
Lock down user paths as E2E regression tests. Explore the feature in a real browser, discover flows, write automated tests, and run them until green.
These tests exist to detect regressions. Once a user path works, it should keep working. The tests are the contract.
Before exploring, confirm a browser MCP is available ā Playwright MCP or mcp__claude-in-chrome__* tools. Without one, you'd be inventing selectors from JSX/HTML source, which produces brittle tests. If nothing is wired up, ask the user to install Playwright MCP, or fall back to npx playwright codegen <url> and have them paste the recorded interactions.
These commands run automatically when the skill loads ā output replaces each line below:
ls playwright.config.* cypress.config.* wdio.conf.* 2>/dev/null || truels -d e2e tests/e2e cypress/e2e test/e2e 2>/dev/null || truecat package.json 2>/dev/null | grep -E '"(e2e|playwright|cypress|test:e2e)"' || trueLook for an existing setup in this order:
playwright.config.*, cypress.config.*, wdio.conf.*, etc.) ā see pre-run outputpackage.json scripts referencing e2e or test runners ā see pre-run outputAlso detect:
Do not skip this step. Open the browser and actually use the feature before writing anything.
You are building a mental model of what the user actually experiences. Code analysis alone is not enough ā the browser shows you reality.
Based on what you experienced in the browser, propose a list of flows:
I explored [feature] and found these user flows:
1. **Happy path** ā [describe the primary successful journey]
2. **Validation** ā [describe what happens with bad input]
3. **Empty state** ā [describe the zero-data experience]
4. **[Other flow]** ā [describe it]
Want to modify this list, add flows, or remove any?
Rules:
Wait for the user to approve, modify, or extend the list before continuing.
For each approved flow, write an E2E test that:
Selector ladder ā use in order, only drop down when the above is ambiguous:
getByRole with accessible namegetByLabel for form controlsgetByText for unique visible copygetByTestId only when 1ā3 are ambiguousPull selectors from the live a11y snapshot (MCP), not from reading the source. If a selector matches multiple elements, narrow with role + name + scope ā never nth-child or index.
Follow the project's existing conventions for:
If no conventions exist, use sensible defaults for the detected framework.
Execute the tests immediately after writing them.
Before declaring green: verify the test exercised the intended path, not a backdoor. Did the assertions pin user-visible outcomes that would actually break if the feature regressed? If the test passed by skipping a step, navigating directly to a success URL, or asserting something trivially always-true, fix the test ā passing ā correct.
If tests pass: Move to the next flow.
If tests fail ā determine the cause:
A) Test is wrong (bad selector, timing issue, wrong assertion, missing setup):
nth-match.B) App is broken (the test accurately represents the flow but the feature doesn't work):
ā Found a regression: [flow name]
The test expects [expected behavior] but the app [actual behavior].
This appears to be a real bug, not a test issue.
Want me to investigate and fix it, or continue writing the remaining flow tests?
When all approved flows have passing tests:
Flows tested: 4
e2e/checkout.spec.ts
ā user completes checkout with valid payment
ā user sees validation errors for expired card
ā user returns to cart from checkout
e2e/checkout-empty.spec.ts
ā user sees empty cart message when checking out with no items
All passing.
Then mention anything extra you noticed while exploring:
While exploring, I also noticed:
- A password reset flow accessible from the login page
- An invite-a-friend modal in account settings
Want me to cover any of these?
Only mention flows that are genuinely distinct ā don't pad the list.
If no E2E framework is detected:
Ask the user before installing dependencies.