An open API service indexing awesome lists of open source software.

https://github.com/nikeshman16/platziapi-postman

Automating api testing with postman and newman CLI consisting of positive and negative test case scenarios for an api
https://github.com/nikeshman16/platziapi-postman

api-testing automation postman

Last synced: 9 months ago
JSON representation

Automating api testing with postman and newman CLI consisting of positive and negative test case scenarios for an api

Awesome Lists containing this project

README

          

# Postman API Test Collection

This repository contains automated API tests using [Postman](https://www.postman.com/) and [Newman](https://www.npmjs.com/package/newman), Postman's command-line tool.

## File Structure

- `collections/`: Contains exported Postman test collections (v2.1).
- `environments/`: Postman environments for future different environments like `dev`, `staging`, etc.
- `.github/workflows/`: Contains the GitHub Actions workflow to run Newman tests on every push.

## ▶️ Running Tests Locally with Newman

### Prerequisite

Install Newman:

```bash
npm install -g newman
```

Install Newman report:

```bash
npm install -g newman-reporter
```

### Running the tests from command line using newman
```bash
newman run collections/Test-project-api.postman_collection.json
```

### Running the tests and report generation using newman CLI
1. Go to the project root directory
2. Open command prompt
3. Enter the following script

Test execution and Report generation command
```bash
newman run collections/Test-project-api.postman_collection.json -r html --reporter-html-export Report.html
```
5. Report.html is the html-report generated in the project root directory.