Skip to content

flow

Module Step Summary
— flow/delay Pause test execution for a fixed duration.
— flow/if Run one of two nested sequences depending on a set of conditions.
— flow/retry Run a nested list of steps, retrying the whole sequence on failure.

flow/delay

Pause test execution for a fixed duration.

Useful where a system under test needs a moment to reach the state the next step asserts on and offers nothing to poll.

Inputs

Parameter Type Required Default Also accepts Description
seconds number no 1 — Seconds to wait.

Output — the value assertions and returns: read

This step produces no value — it acts, and there is nothing to read back.

Type: NoneType

flow/if

Run one of two nested sequences depending on a set of conditions.

A step's own if: decides whether that one step runs; this decides between two sequences, and says afterwards which one it picked — a test asserting on branch_taken can prove the flow went the way it meant to, which "the steps in the other branch were skipped" never quite shows. The conditions are evaluated once, before either branch starts, using the same comparisons a validate: block asserts with.

Inputs

Parameter Type Required Default Also accepts Description
conditions list of Condition yes — — Comparisons evaluated before a branch is chosen.
match all | any no 'all' — Whether every condition must hold ('all') or just one ('any').
then list of StepDefinition yes — — Nested step definitions run when the condition holds — the same shape used at the top level of a test.
else list of StepDefinition no [] — Nested step definitions run when it does not; omitted means the step does nothing in that case.

Output — the value assertions and returns: read

Which way the step went, and what the branch it took produced.

Field Type Description
condition_result boolean How the condition evaluated.
branch_taken then | else | none The branch that ran; 'none' when the condition was false and no 'else' was given.
outputs list of any Outputs of the nested steps that ran, in order.

flow/retry

Run a nested list of steps, retrying the whole sequence on failure.

The sequence stops at the first nested failure and the whole sequence is re-run, so a step that succeeded in a failed attempt runs again — write nested steps to be safe to repeat.

Inputs

Parameter Type Required Default Also accepts Description
steps list of StepDefinition yes — — Nested step definitions ('uses', 'with', 'validate', …) — the same shape used at the top level of a test. A nested step may itself be 'flow/retry'.
max_attempts integer no 3 — Maximum number of attempts.
delay_s number no 1 — Seconds to wait between attempts.

Output — the value assertions and returns: read

The nested steps' outputs, in order, from the attempt that finally passed.

Type: list of any

Nested objects

Assertion

Assertion using uses / with verb-form keys.

Field Type Required Default Also accepts Description
cac list of string no None —
uses string yes — —
name string no None —
with object no None —

Condition

One comparison the branch is decided on.

Field Type Required Default Also accepts Description
input any no None — The value to test, usually a previous step's output.
path string no '' — Dot-notation path into the input, e.g. 'content.state'; empty tests it whole.
operator not_null | is_null | not_empty | equals | not_equals | contains | not_contains | matches_regex | one_of | none_of | has_key | not_has_key | gt | gte | lt | lte | length_equals | length_gt | length_lt | between no 'not_null' — Comparison applied to the value.
value any no None — What the value is compared against; unused by unary operators.

ReturnFieldDefinition

Single output field declared in a step returns block.

Field Type Required Default Also accepts Description
type string yes — —
class string no None —

StepDefinition

Step definition using uses and with verb-form keys.

Field Type Required Default Also accepts Description
cac list of string no None —
id string no None —
uses string yes — —
name string no None —
with object no None —
returns object no None —
validate list of Assertion no None —
expects fail no None —
timeout_s number no None —
if string no None —