Test Studio & mocks
Test Studio is how you break a process on purpose before production does. It builds on simulation: a draft runs on a throwaway engine, nothing is published or stored, and you decide what each outside system answers.
Stubs or mock services
A stub answers with an action's value: nothing is sent and the action's executor never runs. A mock service answers with a real HTTP response. In a mock run the draft's http actions really send their requests, over a real connection, to mock services that the host's WireMock server plays for that one run. No real host is contacted.
Use a mock run to test what a stub cannot:
- the status: a non-2xx answer goes through the action's
onError, so retries and error routes run as in production; - the request: a request no route matches is reported, with the routes that came closest;
- the response handling:
resultPath, responses saved to files, and file and multipart bodies; - time and failure: a slow answer against
timeoutMs, a broken connection, or "fails twice, then answers".
Mock runs are a host feature behind ProcessFlow:Mocks:Enabled. With it off, a plain simulation still works.
Saved scenarios and checks
Every definition key can keep one tests document: its mock services and its scenarios. A scenario is a simulate request without the draft, together with the checks its run must pass. The server judges each check and returns a verdict.
| Check kinds | What they state |
|---|---|
finalStatus, outcome, currentState | Where the run ended |
visited, notVisited, pathEquals | The route it took |
varEquals | A variable's value |
actionCalled, actionNotCalled, faultCode | What the actions did |
resumeCount | How often the instance resumed |
mockCalled, mockCallCount, mockRequestMatches | What the mock services received |
GET and PUT /definitions/{key}/tests read and replace the document. The editor's Tests tab edits it and Run all runs every scenario.
Standing mocks
A saved mock service can be deployed, so it keeps answering for the real instances of a published definition: a demo before a vendor's sandbox exists, or an end-to-end test with real waits, timers and human tasks. On a host that allows it, a deployment can answer for the service's real address, so the definition does not change at all.
The Mocks pages list every mock service of your companies, with who calls them. The Run console's Use deployed mocks starts an instance against them.
Where mocks come from
- Create mock on an
httpaction's form starts a route from that action. - Create mocks from this run copies the calls a real instance made from its history.
- The AI assistant can propose mock services and their failure cases.
In CI
The headless runner does what Run all does, without a browser. It sends one simulate request per scenario, prints a table, writes JUnit and JSON reports when asked, and exits with a code a CI job can act on. It never judges a check itself: the server's verdict decides.
Do not treat a passing mock run as proof that real credentials, service availability or network policies are correct.