This repo contains the Postman collection that I implemented in Postman desktop and exported as .json file to demonstrate my experience in API testing using Postman. The collection can be found here.
The Application Under Test (AUT) is the Contact List App: https://thinking-tester-contact-list.herokuapp.com/
The API documentation can be found here: https://documenter.getpostman.com/view/4012288/TzK2bEa8#intro
In addtion, before actually implementing the tests, I also developed the test plan to list out what tests will be done, the goal of each test, details of implementation and the expeced results. The test plan can be found here.
- Send POST request to register an account
- Send POST request to login to the registred account and get the logged in token to be used in later requests
- Send GET request to get user profile
- Send PATCH request to partially update user (e.g. First Name)
- Send POST request to create a new contact
- Send GET request to get the contact list
- Send GET request to get a specific contact
- Send PUT request to update a contact
- Send PATCH request to partially update a contact
- Send DELETE request to delete a contact
- Send DELETE contact to delete the user
- Use Postman to create POST, GET, PUT, PATCH, DELETE requests and write tests to veriy status code and data in body of responses
- Use dynamic variables to generate random test data so that tests can be run many times without conflict and failing
- Use
pm
object to get, set collection variables in Pre-request Script, Body and Tests - Use
Postman.nextRequest()
to set the order of requests when running collection - Use Monitor to schedule the collection to run once a week on a specific date/time and send email notification when there are failures
- Use Newman to run the collection in CLI, and newman html extra report to generate test report when running test using Newman
- Use Performance feature of postman to run the performance of end to end test flow and view the performance metrics
- Install Postman app
- Download the collection "Contact List API Test.postman_collection.json" from this project
- Import the collection to Postman app
- Run the collection
- Install Newman
npm install -g newman
(remember to install Node.js to use npm) - Run the collection using the command `newman run "Contact List API Test.postman_collection.json"
- Install htmlextra reporter:
npm install -g newman-reporter-htmlextra
- Run the collection using the command
newman run "Contact List API Test.postman_collection.json" --reporters cli,htmlextra
- The report will be generated in the newman folder which is the same location as postman collection
Postman has just introduced Performance Testing recently. It provide ability to run the entire collection by the pre-defined concurrent virtual users within a set period of time.
While the tests are running, user can view the real time report showing the trend of the performance as well as the metrics of each individual request
User can also check the error rate and when error happens