You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-9Lines changed: 22 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,18 @@
1
1
# Postman Collection Runner
2
2
3
-
This project is a Node.js utility to run requests from a Postman collection concurrently. It reads the Postman collection JSON file, processes the requests, and executes them using the `axios` library. The tool provides detailed logs for each request's execution status (success or failure) and tracks the execution time, along with a summary report of the test run.
3
+
This project is a Node.js utility to execute requests from a Postman collection concurrently. It reads the Postman collection JSON file, processes the requests (including handling placeholders and authentication), and executes them using the `axios` library. The tool provides detailed logs for each request's execution status (success or failure), tracks execution time, and generates a comprehensive summary report.
4
4
5
5
## Features
6
6
7
-
- Parse Postman collection JSON and extract requests and global information.
8
-
- Support for multiple authentication types: API Key, Bearer, Basic Auth.
9
-
- Run requests concurrently using `Promise.allSettled` for better performance.
10
-
- Log success and failure of each request along with execution time.
11
-
- Generate a summary report with total execution time, successful/failed requests, and average time per request.
7
+
- Parse Postman collection JSON and extract requests and global information
8
+
- Replace placeholders (e.g., `{{PLACEHOLDER}}`) in the collection with environment variables
9
+
- Support for multiple authentication types: API Key, Bearer, Basic Auth
10
+
- Execute requests concurrently using `Promise.allSettled` for better performance
11
+
- Log detailed information for each request, including success/failure, execution time, and response data
12
+
- Generate a summary report with:
13
+
- Total execution time
14
+
- Successful/failed requests
15
+
- Average time per request
12
16
13
17
## Prerequisites
14
18
@@ -48,9 +52,18 @@ Make sure you have a Postman collection JSON file. If you don't have one, you ca
48
52
- Select `Export` and choose the format `Collection v2.1 (recommended)`.
49
53
- Save the JSON file.
50
54
51
-
### 2. Run the Script
55
+
### 2. Set Up Environment Variables
52
56
53
-
Place your Postman collection JSON file in the `postman-collections` directory or update the path in the script.
57
+
Create a `.env` file in the root directory to define environment variables used in your Postman collection (e.g., replacing `{{PLACEHOLDER}}` values). Example:
58
+
59
+
```env
60
+
API_KEY=your_api_key
61
+
BASE_URL=https://api.example.com
62
+
```
63
+
64
+
### 3. Run the Script
65
+
66
+
Place your Postman collection JSON file in the `postman-collections` directory or update the `COLLECTION_PATH` variable in the `index.js` file to point to your file.
54
67
55
68
To run the utility, use the following command:
56
69
@@ -60,7 +73,7 @@ npm start
60
73
61
74
This will execute the requests in the collection concurrently and log the results in the terminal. You will also see a summary report at the end of the execution.
62
75
63
-
### 3. Customization
76
+
### 4. Customization
64
77
65
78
-**Collection Path**: Update the `COLLECTION_PATH` variable in the `index.js` file to point to your collection file.
0 commit comments