Test Overview
This test uses Postman test utilities to check if the API response status is 200 and if the response body contains a specific key with the expected value.
This test uses Postman test utilities to check if the API response status is 200 and if the response body contains a specific key with the expected value.
pm.test("Status code is 200", function () { pm.response.to.have.status(200); }); pm.test("Response has userId with value 1", function () { const jsonData = pm.response.json(); pm.expect(jsonData.userId).to.eql(1); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Postman app is open with the API request ready | - | PASS |
| 2 | Send API request | Request sent to the server, waiting for response | - | PASS |
| 3 | Receive API response | Response received with status 200 and JSON body | Check if response status is 200 | PASS |
| 4 | Parse response JSON | Response body parsed into JSON object | Verify jsonData.userId equals 1 | PASS |
| 5 | Test ends | All assertions passed, test completed successfully | - | PASS |