Skip to content

Scenarios

scenarios.json contains an array of rules:

{
"rules": [
{
"method": "GET",
"match": "/v1/example",
"enabled": true,
"active_scenario": "success",
"scenarios": { ... }
}
]
}
Terminal window
# hot workflow
Change "active_scenario" from "success" to "error"
See frontend behavior instantly
  • method: HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)
  • match: Request path to match
  • enabled: Whether the rule is active
  • active_scenario: Scenario key to use
  • scenarios: Map of scenario definitions
  • status: HTTP status code (optional, default 200)
  • json: Inline JSON response body
  • file: Fixture file path (relative to project base path)
  • delay: Delay in seconds before response

Each scenario must include at least one of json or file.

Name scenarios by intent

Use labels like success, validation_error, server_error, timeout.

Use fixture files for large payloads

Keep mock data in fixtures/ and reference with file for cleaner config.

Model user pain early

Add delayed and failing scenarios so UI states are polished before release.