Skip to content
Back to skills

Scenario

ASecurity

Design real-world test scenarios — user journeys, role-based flows, recovery paths — independent of execution tool (pytest, Playwright, Postman, etc.).

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 11, 2026
testinggoexpresstestingdebuggingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add trungdo9/ClauKit --skill scenario --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Scenario?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Scenario
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/trungdo9-scenario/badge)](https://www.skillsdirectory.com/skills/trungdo9-scenario)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: scenario
description: Design real-world test scenarios — user journeys, role-based flows, recovery paths — independent of execution tool (pytest, Playwright, Postman, etc.).
category: Testing & Debug
status: active
---

# Scenario

## Purpose

Scenario-based testing is a **design discipline**: enumerate the real-world workflows a system must support and the failure paths it must survive, then express them as runnable test cases. Tool-agnostic.

Distinct from `[[test-automation]]` — how to run tests: runners, Playwright/browser patterns, CI integration. That skill is the single testing toolkit; this one decides *which cases exist*.

## When to Use

- Greenfield feature: derive test set from requirements before implementation
- Regression triage: turn a bug report into a permanent scenario
- Acceptance testing for a release
- Role-based features (admin vs user vs guest)
- Recovery testing (network failures, retries, partial state)

Activation phrases: *"design test scenarios for..."*, *"create user-flow tests"*, *"recovery scenarios for..."*, *"acceptance criteria as scenarios"*

## Scenario Types

| Type | Question it answers |
|---|---|
| **System / golden-path** | Does the main user journey work end-to-end? |
| **Role-based** | Does each persona see the right capabilities and data? |
| **Negative** | What happens when input is invalid, missing, malicious? |
| **Recovery / failover** | What happens when a dependency fails mid-flow? |
| **Data-driven** | Does the system behave correctly across input variations? |
| **Boundary** | Off-by-one, empty set, max size, expiry edges |

A balanced suite covers every type. A suite that's 100% golden-path is theatre.

## Design Process

1. **Extract actors** — who triggers this flow? (user, admin, system job, external webhook)
2. **Map the happy path** — every step from trigger to completion, including state changes.
3. **Branch the unhappy paths** — at each step, ask: "what could go wrong?" → distinct scenario.
4. **Enumerate roles** — repeat the happy path per role; note diverging behavior.
5. **Add boundaries** — for any input with a numeric range, add min, max, min-1, max+1.
6. **Add recovery** — for any external call, add a scenario where it times out or returns 5xx.

## Scenario Template

```markdown
### Scenario: <name>
**Type**: golden | role | negative | recovery | data | boundary
**Actor**: <persona>
**Preconditions**: <state before>
**Steps**:
1. ...
2. ...
**Expected**: <observable outcome>
**Cleanup**: <state after>
```

## Tool Mapping (pick by layer)

| Layer | Tool examples | Notes |
|---|---|---|
| Unit / integration | pytest, JUnit, Vitest | See `[[test-automation]]` |
| API | Postman, curl, supertest, httpx | Express scenarios as request sequences |
| Browser / UI | Playwright, Cypress | See `[[test-automation]]` |
| End-to-end | Playwright + Postman + DB seeders | Compose layers per scenario |

The scenario itself is the same markdown spec — only the execution tool changes.

## Anti-Patterns

- **Scenario inflation**: 200 near-duplicate scenarios. Fix: parameterize via data-driven scenarios.
- **No cleanup**: tests pollute each other. Fix: every scenario declares state pre/post.
- **Golden-path-only suite**: gives false confidence. Fix: require at least 1 negative + 1 recovery per feature.
- **Implementation-coupled scenarios**: "click button X" instead of "submit form". Fix: write at user-intent level; let the executor map to UI.

## References

See `references/`:
- `browserstack-test-scenarios-2025.md` — modern methodology
- `geeksforgeeks-scenario-testing.md` — definition + canonical examples
- `testsigma-test-scenario-guide.md` — best practices, positive/negative

## Cross-links

`[[test-automation]]`, `[[tdd]]`, `[[debugging]]`

Files in this skill

  • SKILL.md3.7 KB
  • references/browserstack-test-scenarios-2025.md1.5 KB
  • references/geeksforgeeks-scenario-testing.md1.5 KB
  • references/testsigma-test-scenario-guide.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.