File tree Expand file tree Collapse file tree 1 file changed +71
-1
lines changed
Expand file tree Collapse file tree 1 file changed +71
-1
lines changed Original file line number Diff line number Diff line change 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.
You can’t perform that action at this time.
0 commit comments