Working through the radwanSQA Postman repo as practice. Three collections, all run via Newman.
| Collection | API | Requests | Assertions |
|---|---|---|---|
| BookingApi | restful-booker.herokuapp.com | 6 | 9 |
| FakeRestApi | fakerestapi.azurewebsites.net | 27 | 0 |
| StudentInfoApi | thetestingworldapi.com | 7 | 25 |
Hotel booking API. Tests the full create/read/update/delete flow with token auth.
| Request | Method | Notes |
|---|---|---|
| CREATE booking | POST | Saves returned bookingid as {{Id}} |
| GET booking | GET | Reads back what was just created |
| token | POST | Gets auth token, saves as {{accessToken}} |
| UPDATE booking | PUT | Needs the token in Cookie header |
| DELETE booking | DELETE | Needs the token in Cookie header |
The original collection had token after UPDATE — so UPDATE always got a 403 because the token didn't exist yet. Moved token before UPDATE, now it works.
Five resource types: Activities, Authors, Books, Cover Photos, Users. Each has the standard GET/POST/GET by ID/PUT/DELETE requests. No assertions written in this one.
Student management API. Creates a student, adds an address, then fetches the combined record.
| Request | Method | Notes |
|---|---|---|
| GET Students | GET | List all |
| CREATE Student | POST | Saves {{id}} |
| GET Specific Student | GET | 4 assertions fail — see report |
| UPDATE Student | PUT | |
| Create Address | POST | Links address to student |
| Final Student Details | GET | Validates student + address together |
| DELETE Student | DELETE |
npm install -g newman newman-reporter-htmlextra
newman run "BookingApi/booking.postman_collection.json" \
-e "BookingApi/booking.postman_environment.json" \
-r cli,htmlextra \
--reporter-htmlextra-export reports/BookingApi-report.html// Save value from response to use in next request
var jsonData = pm.response.json();
pm.environment.set('Id', jsonData.bookingid);
// Basic status check
pm.test("Status 200", function () {
pm.response.to.have.status(200);
});
// Check response fields
pm.test("Check fields", () => {
const json = pm.response.json();
pm.expect(json.firstname).to.eql('Test');
pm.expect(json.bookingid).to.be.a('number');
});- https://restful-booker.herokuapp.com/apidoc/index.html
- https://fakerestapi.azurewebsites.net
- https://reqres.in/
- https://jsonplaceholder.typicode.com/
- https://httpbin.org/
- https://gorest.co.in
- https://pokeapi.co/
- https://rickandmortyapi.com/documentation
- http://dummy.restapiexample.com/
- http://www.omdbapi.com/