StrikekitStrikekit

api wait

Poll by re-issuing the last API request until a JSON path matches

Re-issue the last completed API request until a gjson path equals the expected value (or timeout). Authors usually api get the status URL first, then wait.

Syntax

And I api wait until json path "<path>" be "<expected>"

Forms

FormMeaning
api wait until json path "<path>" be "<expected>"Poll last request until path string equals expected

Qualifiers

QualifierRole
until json pathgjson-style path to poll ($.status, …)
beExpected string value (resolved)

Examples

When I api post "/jobs" with body '{"type":"export"}'
Then I api should status "202"
When I store "@job-id" from api json "$.id"
When I api get "/jobs/@job-id"
And I api wait until json path "$.status" be "ready"
Then I api should json path "$.status" be "ready"

Notes

  • Each poll tick replays the last request (same method, path, and body or multipart snapshot) and updates the last response.
  • Timeout is about 30s; interval matches other assertion polls (~250ms).
  • On timeout, the error includes the last observed path value when the path exists.
  • Distinct from one-shot api should json path … be (no polling) and from UI wait for response (browser XHR).

On this page