AutomationExercise_API_Testing

🚀 API Testing using Postman and Newman

Postman API Tests ________________________________________________

👓 Overview

This project focuses on testing the API of https://automationexercise.com/, an online platform for practicing API testing. Created a Postman test collection, tested it manually in Postman, and integrated Newman with GitHub Actions to execute the tests in CI pipeline, ensuring continuous API quality and reliability. ***

🏁 Getting Started

🔤 Prerequisites

Node.js Postman Newman ***

🪛 Installation

git clone https://github.com/anikush-yes/AutomationExercise_API_Testing.git

cd AutomationExercise_API_Testing (Or the name You gave)

npm install -g newman


🏃‍♀️‍➡️ Running API Tests

### 1.Using Postman

2.Using Newman

npm test

3.Using GitHub Actions


💞 Expected Results


📥📤 API Endpoints Tested

1. Products

GET /productsList - Retrieve all products

POST /productsList - Verify invalid request handling

2. Brands

GET /brandsList - Retrieve all brands

PUT /brandsList - Verify method not supported

POST /searchProduct - Search for products

POST /searchProduct (without parameter) - Verify bad request handling

4. User Authentication

POST /verifyLogin - Verify login with valid credentials

POST /verifyLogin (without email) - Verify error handling

POST /verifyLogin (invalid details) - Check invalid login attempt

DELETE /verifyLogin - Verify unsupported method handling

5. User Account Management

POST /createAccount - Create a new user

PUT /updateAccount - Update user details

GET /getUserDetailByEmail - Retrieve user details

DELETE /deleteAccount - Delete user account

6. Negative Path Testing

  1. Invalid product search

  2. Account creation without required fields

  3. Retrieving non-existent user account


📥📤 Example Request & Response

GET /productsList

📥Request:

GET /productsList HTTP/1.1 Host:

📤Response:

{ "responseCode": 200, "products": [ { "id": 1, "name": "T-shirt", "price": "15.99", "brand": "Nike", "category": { "usertype": { "usertype": "Men" }, "category": "Clothing" } } ] }

POST /searchProduct

📥 Request:

POST /searchProduct HTTP/1.1 Host: Content-Type: application/x-www-form-urlencoded search_product=jeans

📤 Response:

{ "responseCode": 200, "products": [ { "id": 5, "name": "Blue Jeans", "price": "49.99", "brand": "Levi's", "category": { "usertype": { "usertype": "Men" }, "category": "Clothing" } } ] } ***

📝 Notes


🪪 License

This project is licensed under the MIT License. ***

⭐ If you like this project, don’t forget to give it a star! ⭐