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: confirmed

Fields of an api: step

FieldMeaning
get, post, put, deleteThe method, with the path as its value. One per step.
bodyOptional request body.
expect.statusExpected 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.