When working with APIs, do you typically test multi-step flows like authenticating, creating resources, updating them, verifying changes, and cleaning up through your API client? Or do you move these tests into your codebase and run them as part of your testing suite? I'm curious if you run these steps manually as separate requests or if you utilize tools that allow sequences of requests to be executed together.
5 Answers
Yeah, it's often referred to as a "multi-step operation." I only test these on the API side because frontends can be unreliable—requests might not get sent or could end up malformed. Testing is definitely key!
You might want to check out a tool called t-req for handling this! It can help organize those workflows nicely. For us, we keep our collections within our codebase, so they can share context and keep everything versions in sync. Just a heads up, I built t-req, so I'm a bit biased, but it’s worth a look!
I usually handle this in my integration tests. I really dislike over-mocking things because it can lead to a false sense of security. End-to-end (E2E) tests for these multi-step operations are super essential since they are often the most complicated.
I don’t really know much about this topic, but I love how passionate everyone here is! Makes me think I should dive deeper into learning about APIs and testing.
I generally do it all manually, LOL. It's a bit of a hassle, but it works for me!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically