Inspect and reset scenario state
Before you begin
- Role
- Viewer or higher to see the current state and Editor or higher to move or reset a scenario.
- You need
- A project with a scenario, or a mock with a response sequence
A scenario’s state changes as requests arrive. MockHub keeps it apart from the project’s configuration until the scenario goes seven days unused. The Scenarios tab shows the state of each scenario, moves one to another state, and puts scenarios back to Started so that a test run begins from a known point.
See the current state
Section titled “See the current state”- Open the project’s Scenarios tab.
Each scenario lists Started and its own states, with the state it is in marked as the current one, and says how many mocks use it.
The states follow requests as they arrive: when a request moves a scenario, its new state is marked a moment later, and so is a move or a reset made elsewhere, such as in another tab. Live above the list says it is following. While it reads Reconnecting…, or there is no tag, select Refresh live state to read the states again.
Not running yet means no mock uses the scenario; Add a mock on its row starts one. State unknown means none of its mocks is active, or the mock server did not answer. A scenario whose mocks are all inactive keeps its state, and shows it again once one of them is active. While a scenario is not running or its state is unknown, its states are listed without being selectable, and it has no Reset.
Move a scenario to a state
Section titled “Move a scenario to a state”-
Open the project’s Scenarios tab.
-
In the scenario’s list of states, select the one to move it to.
The next request is answered as if the flow had reached that state. Use it to test one step of a flow without replaying the steps before it.
A state can be chosen only while an active mock uses the scenario. If its last active mock goes inactive in another tab first, MockHub says, for a scenario named payment, “Activate a mock that uses scenario “payment” before setting its state.”
Reset scenarios
Section titled “Reset scenarios”To put one scenario back to Started, select Reset on its row.
To put every scenario of the project back:
-
Open the project’s Scenarios tab.
-
Select Reset all.
Reset all also rewinds every response sequence in the project to its first response. The scenarios behind sequences are listed only while Show generated scenarios is on, marked Generated, and cannot be moved or reset one at a time.
It resets the scenarios and sequences of inactive mocks too, so none of them comes back in an older state when its mock is active again. Reset on one scenario’s row does the same for that scenario.
Reset from the CLI or an AI assistant
Section titled “Reset from the CLI or an AI assistant”A test suite that starts from a known point resets before each run, without the app. Both of these do what Reset all does:
mockhub scenarios reset, from a terminal or a pipeline, for the project inmockhub.yaml.--env <name>chooses the target when the file has more than one, as formockhub push, and--project <id>names a project instead, such as an ephemeral environment. It printsReset 1 scenario(s) and 2 response sequence(s): the next request starts each from the beginning., with the project’s counts. See CLI commands.reset_scenarios, from an AI assistant connected over MCP, which answers with the names it reset, a response sequence asseq:and its mock’s id. See MCP workflows.
Both need the Editor role, and a machine token may run them, as it may apply a fixture. Each scenario and sequence is reset on its own: if the mock server fails partway, some are back at the start and some are not, and running the reset again finishes it.
Result
Section titled “Result”The list reloads with the new states. Reset shows Scenario reset and names the scenario; Reset all shows Scenarios reset, with how many scenarios are back in Started.
Limits
Section titled “Limits”- State is not part of the project’s saved configuration. MockHub keeps it while the scenario’s mocks are inactive, and when a mock is edited or a chaos profile starts or stops. A scenario goes back to
Startedafter seven days unused: a request its state decides, a move and a reset count as use, and opening this tab does not. - A failure on MockHub’s side can lose about the last second of moves, and MockHub’s backups do not include scenario state.
- While MockHub cannot read or save a scenario’s state, a mock that depends on it answers
503with Scenario unavailable rather than guessing; mocks without a scenario keep answering. - One state per scenario is shared by every caller, so a reset in the middle of someone else’s run changes their answers too.
- Moving or resetting needs the project’s mock server. When it cannot be reached, MockHub says “The mock server for this project could not be reached.” Select Refresh live state to see where the scenarios are.
- A scenario can be moved only to one of its own states or to
Started. - The state is not part of the project’s configuration document; applying one does not set it.
- When a scenario goes back to
Startedafter seven days unused, or because you removed the state it was in from its list, the list is not told. Select Refresh live state to see it.