Write YAML
Yet Another API Test Tool
API testing shouldn’t feel like filing taxes.
Write a test as a YAML file. Run the Docker image. YAATT sends the requests, runs the assertions, and prints a pass or fail. No clone, no extra app, no special test language.
Run tests
View results
The job was always simple.
Call an API. Write assertions on the reply. Folders, extra syntax, and workspace sync get in the way of that.
- Postman is great for clicking buttons. The tests are hard to read, and harder to review in a pull request.
- Special test languages look nice at first. You end up maintaining the framework instead of the tests.
- YAATT is the file you already wanted. Name each request. Say what the response should look like. That is the test.
What you get
If you can write a YAML file, you can write a test.
YAML first
Write tests in YAML so they stay easy to scan. JSON works too. Put
files in tests/.
YAML linting
Copy schema.json, install the YAML extension, and add a
schema comment. Autocomplete and errors while you write.
See the steps.
Just Docker
Pull iamuzorr/yaatt and mount tests/. You
never have to clone this repo to run tests.
Assertions that read clearly
Equals, not empty, status code, and a few more. Each line says what it is asserting.
Reuse values
Take a field from an earlier response, read an environment variable, or generate a unique id.
Readable output
Every request and assertion is printed. The run passes or fails like any other test command.
A test is just a file
YAATT sends each request from top to bottom. It remembers each response by the name you gave it, then runs your assertions against those replies. A fail prints what you expected next to what came back.
name: Product catalog
requests:
get_products:
method: get
url: https://dummyjson.com/products
add_product:
method: post
url: https://dummyjson.com/products/add
body:
title: hello_world
price: "{{gen:number}}"
assertions:
- property: get_products
type: status_code
value: 200
- property: get_products.products
type: is_not_empty
- property: get_products.products[0].id
type: is_equals
value: 999 TEST SUITE Product catalog (catalog.yml) REQUESTS 🚀 get_products 200 0.31 secs 🚀 add_product 201 0.42 secs ASSERTIONS Pass get_products status code is "200" Pass get_products.products is not empty Fail get_products.products[0].id is equals to "999". (actual: 1) RESULT: FAILED (2 passed, 1 failed, 0.89s)
Quick start
mkdir -p tests docker run --rm \ -v $(pwd)/tests:/app/tests \ -t iamuzorr/yaatt
Put YAML in tests/, then run the published image. A
Makefile, environment variables, and CI examples are in the
usage docs.
Work with me
YAATT is a side project by UZOR, a software engineer who builds APIs and the tools around them. If you want help shipping something similar, send a note.