Skip to content

Commit 460f8e7

Browse files
committed
Update README.md to enhance project documentation and provide detailed instructions for API contract tests
1 parent 44a2de6 commit 460f8e7

File tree

1 file changed

+71
-1
lines changed

1 file changed

+71
-1
lines changed

README.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,71 @@
1-
# JSONPlaceholder-API-Tests
1+
# JSONPlaceholder API Contract Tests
2+
3+
This repository contains automated **API contract and health tests** for the public JSONPlaceholder API using Postman.
4+
The goal is to ensure response structure, data types, and status codes remain consistent with the documented API behavior.
5+
6+
---
7+
8+
## 🚀 Overview
9+
10+
This project validates:
11+
12+
- HTTP status codes
13+
- Response times
14+
- JSON schema/contract for posts
15+
- Handling of path parameters
16+
- Stability of the `/posts` resources
17+
18+
Tests run automatically using:
19+
20+
- **Postman**
21+
- **Newman**
22+
- **GitHub Actions CI pipeline**
23+
24+
---
25+
26+
## 📁 Project Structure
27+
28+
```
29+
/postman/
30+
├── JSONPlaceholder API Contract Tests.postman_collection.json
31+
└── Development Environment.json
32+
.github/workflows/
33+
└── api-tests.yml
34+
```
35+
36+
---
37+
38+
## 🧪 How to Run Locally
39+
40+
### 1. Install Newman
41+
42+
```bash
43+
npm install -g newman
44+
```
45+
46+
### 2. Run the Collection
47+
48+
```bash
49+
newman run "postman/JSONPlaceholder API Contract Tests.postman_collection.json" \
50+
-e "postman/Development Environment.json"
51+
```
52+
53+
### 3. Run with HTML Report (Optional)
54+
55+
```bash
56+
newman run "postman/JSONPlaceholder API Contract Tests.postman_collection.json" \
57+
-e "postman/Development Environment.json" \
58+
-r htmlextra
59+
```
60+
61+
---
62+
63+
## 🌐 API Under Test
64+
65+
All tests run against:
66+
67+
```
68+
https://jsonplaceholder.typicode.com
69+
```
70+
71+
The base URL is configured via the `baseUrl` environment variable in the environment file.

0 commit comments

Comments
 (0)