My notes from ChatGPT: List of Cancer hospitals in India

Here is a list of some well-known cancer hospitals in India: Tata Memorial Hospital, Mumbai : One of the oldest and most reputed cancer hospitals in India, known for its comprehensive cancer care and research. All India Institute of Medical Sciences (AIIMS), New Delhi : AIIMS is a premier medical institute in India with a dedicated cancer treatment center that offers advanced care and research facilities. Adyar Cancer Institute, Chennai : Known for its expertise in cancer treatment and research, particularly in radiation oncology and surgical oncology. Rajiv Gandhi Cancer Institute and Research Centre, Delhi : A leading cancer hospital providing comprehensive cancer care with state-of-the-art facilities. Cancer Institute (WIA), Chennai : Founded by Dr. Muthulakshmi Reddy, it is one of the oldest cancer hospitals in India, known for its pioneering work in cancer treatment and research. Apollo Hospitals, Chennai : Part of the Apollo Group, it offers specialized cancer care across various...

Using Newman Client for API Testing - Part 1

Hello Friends,

In this post, I am going to share with you how you can use newman client to test your API(s). I am writing this blog in two parts.
Part 1 Objective:
To be able to use newman client to test API(s)
For this we'll do:
  1. Create an API. You can create the API in any language like .Net, .Net core, php, nodejs. For this sample, I have created an API using NodeJS and express and I have used only the GET API(s) to keep it simple
  2. Test that API(s) once in postman.
  3. Setup Asserts
  4. Export the collection. 
  5. Create a nodejs project or use this github repo
  6. Setup newman. Checkout package.json in the repo.
  7. Test the collection using newman
Part 2 Objective:
To integrate newman in Azure DevOps CI\CD so that our API(s) can be tested automatically as part of CI\CD. We'll discuss the steps in next post.

So, let's get started with our first objective. 
Here is the github repo.
Here are the steps you can follow:
  1. Clone the github repo
  2. Ensure that you have nodejs installed.
  3. In the folder, which contains package.json, run the following command:
    npm install
  4. Install npx globally, so that you can access local node modules using npx:
    npm install -g npx
  5. Open Terminal and run:
    npm run start
  6. You should have an api running at port 3000.

    So, here basically npm reads the package.json and checks out the 'start' in scripts section. This will further read main.js and will have an express js server running at port 3000. Also, you can see the following code which is nothing but an API endpoint.
  7. So, we have a working API running which can be tested in postman or even directly as this is a get only api.
  8. Adding Tests/Asserts. You can do this in Tests Section of each API:
  9. Next, let's talk about the postman collection. I am having a collection added already with name mycollection.json. You can export a collection as shown in the picture below:
  10. Let's try understanding the collection. So, we can see that postman collection is easily readable
  11. To add more tests, you can add in the Postman and can re-export the collection
  12. Open another terminal so that the API is running and run the following command
    npm run test
    So, if you checkout package.json, I have installed newman and when we run npm run test it is running the newman collection. Checkout the 'test' in package.json under scripts section
  13. Yay! The tests-report.txt will be generated which will look like this:
This was easy huh! :) We'll do the CI\CD setup in the next post.