Back to stories
<QA/>
Premium

Testing REST APIs with Postman (Part 2)

Share by

Testing REST APIs with Postman (Part 2)

Part 1 covered creating requests and inspecting responses. This post (Part 2) goes deeper: writing tests (assertions) with real examples, using pre-request and test scripts with variables to chain requests, running collections in the Collection Runner, and automating everything in CI with Newman.


Tests (assertions) in depth

In the Tests tab of a request, you write JavaScript that runs after the response is received. Postman provides pm (postman object) for assertions and inspection.