https://github.com/omarelsheikh1/petstore-e2e-tests
This repository contains an end-to-end testing setup for the Pet Store API using Postman and Newman. It includes a Postman collection with 7 API requests for CRUD operations, environment configurations, and automated execution via Newman. Detailed HTML reports are also generated for better insights.
https://github.com/omarelsheikh1/petstore-e2e-tests
api-testing e2e-tests newman petstore postman
Last synced: 4 days ago
JSON representation
This repository contains an end-to-end testing setup for the Pet Store API using Postman and Newman. It includes a Postman collection with 7 API requests for CRUD operations, environment configurations, and automated execution via Newman. Detailed HTML reports are also generated for better insights.
- Host: GitHub
- URL: https://github.com/omarelsheikh1/petstore-e2e-tests
- Owner: OmarElsheikh1
- Created: 2025-02-01T22:18:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-22T11:37:58.000Z (over 1 year ago)
- Last Synced: 2025-02-22T12:27:09.819Z (over 1 year ago)
- Topics: api-testing, e2e-tests, newman, petstore, postman
- Homepage: https://petstore.swagger.io/#/pet
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pet-Store_E2E-Scenario
Pet Store_E2E Scenario New Pet Registration,
This project involves using Postman to test the Pet Store API. I created a collection with seven API requests and ran them using Newman, a command-line collection runner for Postman. Below are the steps I followed to set up and execute the task.
------
## Setup Steps
#### 1. **Create the Collection**
I created a Postman collection named **Pet Store**, which includes seven requests:
- **POST**: Add a new pet
- **GET**: Get the pet by ID
- **PUT**: Update an existing pet
- **GET**: Get the pet by ID again
- **DELETE**: Delete the pet by ID
- **GET**: Assert the pet is deleted successfully
- **GET**: Find pets by status
Here’s a visual representation of the collection:
------
#### 2. **Install Node.js**
Newman requires Node.js to run.
Download and install Node.js from [Node.js official website](https://nodejs.org/). NPM, which is included with Node.js, will be installed automatically.
------
#### 3. **Install Newman**
Run the following command to install Newman globally on your device:
```
npm install -g newman
```
Verify the installation by checking the Newman version:
```
newman -v
```
------
#### 4. **Run the Collection**
I used the following command to run the collection and environment variables:
```
newman run Nawy_collection.json -e Nawy_environment.json
```
This executes the requests in the collection using the provided environment variables.
------
#### 5. **Generate an HTML Report**
To make the test results more presentable, I installed the `newman-reporter-htmlextra` package globally:
```
npm install -g newman-reporter-htmlextra
```
Then, I ran the collection again with the `htmlextra` reporter to generate an HTML report:
```
newman run Nawy_collection.json -e Nawy_environment.json -r htmlextra
```
------
## Outputs
- A summary of the collection's execution is displayed in the terminal.
- An HTML report is generated, providing detailed results for each request in the collection.
