Utilities
Random
Section titled “Random”| Inputs | min, max (numbers), seed |
| Outputs | result |
op | Returns |
|---|---|
int | An integer between min and max |
float | A float |
string | A string of length characters |
boolean | A boolean |
pick | An element drawn from items |
The seed field (a number or a string) makes the draw deterministic: that
is what gives you varied data but a reproducible test. It is the essential
difference from the {{$random…}} helpers, which are never reproducible.
Schema validate
Section titled “Schema validate”| Inputs | value, schema (string) |
| Outputs | valid, invalid, errors |
| Configuration | schema — a JSON Schema, in draft-07, 2019-09 or 2020-12 |
The tool of choice for checking that a response honours its contract. Wire
errors onto a Log: the output details every violation, which makes a CI
failure directly actionable.
Requête HTTP ──response[body]──► Validation schéma ├─ valid ──► (suite) ├─ invalid ──► Throw └─ errors ──► LogRead file
Section titled “Read file”| Inputs | path (string) |
| Outputs | content (string) |
| Configuration | path — absolute, or relative to the open .restorm file |
The relative path is what you should use so that the scenario stays portable between your machine and CI.
Write file
Section titled “Write file”| Inputs | path (string), content |
| Outputs | none |
| Configuration | path, mode: replace (default) or append |
| Inputs | message (string), data |
| Outputs | none |
| Configuration | level: debug, info, warn, error |
This is the traceability box. Its entries are the only ones shown by default in
the execution log and on the
command line’s output — the engine’s
entries are only added with --all-logs.
In other words: what you write with Log is what you will find again in your CI’s artefacts.
Assert
Section titled “Assert”| Inputs | a (the observed value), b (the expected value), message (string) |
| Outputs | then (success), else (failure) |
| Configuration | operator, a, b, message |
Available operators:
eq · ne · lt · lte · gt · gte · contains · isString ·
isNumber · isBoolean · isArray · isObject · isNull · exists ·
isEmpty · matchesRegex · isOneOf · deepEquals · lengthEq ·
lengthGt · lengthLt
The message field is what will make a failure comprehensible in the log: write
there what was expected, not “error”.
| Inputs | message (string) |
| Outputs | none — this box has no done port |
| Configuration | message |
Fails the run deliberately. That is what gives you exit code 1 in CI: wire it
onto the else output of your critical assertions or onto a schema validation’s
invalid.