Tests (evaluations) check a callable flow against known inputs. Each test sends input to the Flow input, does a test run of the draft (effects simulated) and checks the Return output.
A flow needs a Flow input (and a Return) to be tested.
Write a test
- Open Tests in the editor header and press Add test.
- Name it and give the Input as JSON for the Flow input.
- Add checks: The Return output must … at a path (empty: the whole output) with a value.
- Save, then Run all.
| Operator | Passes when the value at the path |
|---|---|
equals / notEquals | equals / doesn't equal the value |
contains | contains the value (text or list) |
empty / notEmpty | is empty / isn't empty |
greater / less | is greater / less than the number |
regex | matches the regular expression |
Example
{
"id": "c1",
"name": "Finds a tumbler",
"input": { "keyword": "tumbler stainless 1 liter" },
"expect": [
{ "path": "link", "operator": "notEmpty", "value": "" },
{ "path": "link", "operator": "regex", "value": "^https://s\\.shopee\\.co\\.id/" }
]
}
The dialog shows Passed / Failed per test and Last run 2 minutes ago: 3/4 passed. Each result is kept with the flow (one evaluation record per flow, the last run only):
{ "caseId": "c1", "runId": "6ae1…", "status": "SUCCEEDED", "isPassed": false, "output": { "link": null }, "failure": ["link: expected not empty"], "durationMs": 48210 }
FAQ
Do tests post or buy anything?
No. Every test is a test run, so effect nodes are simulated.
Why does Run all say "Save the flow first"?
Tests run the draft as it is now; running first waits until the server has your latest edits. If it says they haven't arrived, wait for Synced and run again.