Login → Create → Fetch → Delete
This end-to-end CRUD flow logs in, creates a resource, reads it back, and deletes it. Use it to validate critical user journeys and keep common operations green in CI.
Required env vars
EMAIL(CI secret)PASSWORD(CI secret)- Optional:
APIbase URL per environment
How to run it
devtools flow run crud-example.yamlTODO:
- Add a diagram/screenshot showing ID and token mapping between steps.
- Short clip of the flow running successfully end-to-end.
# crud-example.yaml
version: 1
name: CRUD example
env:
API: https://api.example.com
EMAIL: {{#env:EMAIL}}
PASSWORD: {{#env:PASSWORD}}
requests:
- id: login
method: POST
url: {{ env.API }}/login
body:
json:
email: {{ env.EMAIL }}
password: {{ env.PASSWORD }}
expect:
- status: 200
- id: create_item
method: POST
url: {{ env.API }}/items
headers:
Authorization: Bearer {{ login.response.body.token }}
body:
json:
name: Test Item
expect:
- status: 201
- id: get_item
method: GET
url: {{ env.API }}/items/{{ create_item.response.body.id }}
headers:
Authorization: Bearer {{ login.response.body.token }}
expect:
- status: 200
- id: delete_item
method: DELETE
url: {{ env.API }}/items/{{ create_item.response.body.id }}
headers:
Authorization: Bearer {{ login.response.body.token }}
expect:
- status: 204
What to change
- Endpoints:
/loginand/items. - Token path:
login.response.body.token. - Resource ID path:
create_item.response.body.id. - Add body/schema assertions for created and fetched resource.
Common variations
- Create → update → fetch → delete workflow.
- Pagination when verifying list endpoints.
- Retries/backoff on flaky write operations.
- Data setup/teardown via fixtures or sub-flows.