API steps Beta
API steps are in beta. A step can call an HTTP endpoint and check the response, in the same test as UI steps.
tests/checkout.test.yaml
1steps:2 - Click "Place order"3 - assert: The order confirmation page shows an order number4 - api:5 get: /api/orders/latest6 expect:7 status: 2008 body.status: confirmedFields of an api: step
| Field | Meaning |
|---|---|
get, post, put, delete | The method, with the path as its value. One per step. |
body | Optional request body. |
expect.status | Expected HTTP status code. |
expect.<dot.path> | Expected value at a path in the response body, for example body.status. |
Limits
API steps check responses. They do not replace load testing.