yapitest
API testing without the boilerplate — define your tests in YAML, not code.
Yapitest runs HTTP test sequences from plain YAML files. No test runners, no assertion libraries, no expect(value).toBe(0). Declare what to call, what to send, and what to expect back — yapitest handles the rest.
Example
test-create-and-get-post:
setup: create-user
steps:
- id: create-post
path: /api/post/create
method: POST
headers:
API-Token: $setup.token
data:
title: Some Title
body: Some message
assert:
status-code: 201
headers:
content-type: "re/application/json.*"
- path: /api/post/$create-post.response.post_id
assert:
headers:
content-type: "re/application/json.*"
body:
title: Some Title
body: Some message
setup runs a reusable step-set (defined in a config file) before the test begins. $setup.token and $create-post.response.post_id reference values from earlier steps — no glue code required.
Features
- Multi-step flows with
$variablereferences (bare or${...}) to earlier responses, request bodies, and setup data — inline anywhere a string appears. - Reusable step-sets for shared setup/teardown, optionally parameterized with
args($args.<key>). - Rich assertions — status codes (exact, wildcard, or list), typed fields (
+str,+int, …), presence/absence/null (+exists,+absent,+null), numeric comparisons (>=1), regex, length, array membership (+exists) and indexing, response headers, and request duration. - Hierarchical config — base URLs and variables (literal, env-var, or regex-generated) that chain from parent directories.
- Auto-encoded query strings, per-step
wait/retry, parallel execution, group/name filtering, and CTRF reports.
Full documentation: cd-4.github.io/yapitest.
Installation
Install with Cargo:
Usage
Point yapitest at a directory or one or more YAML files:
Filtering
Flags can be repeated to filter by multiple values:
Parallelism
By default, yapitest picks an appropriate thread count automatically. Override with -t:
Verbosity
CTRF Report
Write a CTRF JSON report to a file:
Documentation
Full documentation is available at cd-4.github.io/yapitest.