Scenarios
Scenarios let you group mocks together and apply per-mock overrides — perfect for testing complete user flows or switching between different application states.
What is a Scenario?
A scenario is a named collection of mock references with optional overrides. When a scenario is active, Mock Studio applies the scenario-specific settings on top of the base mock definitions.
For example, a "Checkout Error" scenario might override:
- The payment endpoint to return a
402status - The cart endpoint to still return a
200with items - Add a 2-second delay to the payment endpoint
Creating a Scenario
Manual Creation
- Open a project's detail page
- Click "New Scenario"
- Enter a name and optional description
- Add mocks to the scenario from the available list
From Network Capture (Pro)
- Go to the Network tab
- Select multiple captured requests using checkboxes
- Click "Create Scenario"
- Optionally let AI generate a name and description
- All selected requests become mocks linked to the new scenario
Editing a Scenario
Open a scenario to configure per-mock overrides:
Per-Mock Settings
For each mock in the scenario, you can override:
- Response Body — Custom response for this scenario
- Status Code — Different HTTP status (e.g., 200 → 500)
- Delay — Artificial latency in milliseconds
- Enable/Disable — Toggle individual mocks within the scenario
- Variant Selection — Pick which variant to use
Adding Mocks
- Click "Add Mock" in the scenario editor
- Search through available mocks in the project
- Click to add them to the scenario
Removing Mocks
Click the trash icon next to any mock to remove it from the scenario.
Activating Scenarios
In the project details page, you can set the active scenario. When a scenario is active:
- Mock Studio checks if the intercepted request matches any mock in the active scenario
- If it matches, the scenario overrides are applied
- If the mock isn't in the scenario, the base mock response is used
Use Cases
- Happy path vs Error path — Switch between success and failure states
- Different user roles — Admin view vs Regular user
- Performance testing — Add delays to simulate slow servers
- Demo environments — Pre-configured data states for demos
- E2E test fixtures — Reproducible mock states for automated tests