Test Overview
This test sends a DELETE request to remove a user by ID and verifies that the response status code is 200, confirming successful deletion.
This test sends a DELETE request to remove a user by ID and verifies that the response status code is 200, confirming successful deletion.
pm.test("Status code is 200", function () { pm.response.to.have.status(200); }); pm.test("Response body confirms deletion", function () { const jsonData = pm.response.json(); pm.expect(jsonData.message).to.eql("User deleted successfully"); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Postman app is open with DELETE request prepared | - | PASS |
| 2 | Sends DELETE request to https://api.example.com/users/123 | Request sent to server to delete user with ID 123 | - | PASS |
| 3 | Receives response with status code 200 and JSON body | Response body: {"message": "User deleted successfully"} | Check if status code is 200 | PASS |
| 4 | Checks response body message equals 'User deleted successfully' | Response JSON parsed | Verify response message confirms deletion | PASS |
| 5 | Test ends with all assertions passed | Test report shows success | - | PASS |