Skip to content

Commit 63cb0c2

Browse files
committed
update
1 parent fd508ac commit 63cb0c2

File tree

3 files changed

+45
-31
lines changed

3 files changed

+45
-31
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ name: Newman CLI Tests Execution
44
on:
55
# Triggers the workflow on push or pull request events but only for the "main" branch
66
push:
7-
branches:
8-
- master
7+
branches:
8+
- master
99
pull_request:
10-
branches: [ "master" ]
10+
branches: ["master"]
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
@@ -17,33 +17,31 @@ jobs:
1717
test_api_collection:
1818
runs-on: ubuntu-latest
1919
steps:
20-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21-
- uses: actions/checkout@v3.3.0
22-
23-
24-
# INstall Node on the runner
25-
- name: Install Node
26-
uses: actions/setup-node@v3.6.0
27-
with:
28-
node-version: '16.x'
29-
30-
# Install the newman command line utility and also install the html extra reporter
31-
- name: Install newman
32-
run: |
33-
npm install -g newman
34-
npm install -g newman-reporter-htmlextra
35-
# Make directory to upload the test results
36-
- name: Make directory for results
37-
run: mkdir -p TestResults
20+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
- uses: actions/checkout@v3.3.0
3822

23+
# INstall Node on the runner
24+
- name: Install Node
25+
uses: actions/setup-node@v3.6.0
26+
with:
27+
node-version: "16.x"
3928

40-
# Run the POSTMAN collection
41-
- name: Run Sample Postman Collections
42-
run: |
43-
newman run collections/postman_collection.json --reporters cli,htmlextra --reporter-htmlextra-export TestResults/HtmlReport.html
44-
# Upload the contents of Test Results directory to workspace
45-
- name: Output the run details
46-
uses: actions/upload-artifact@v3.1.2
47-
with:
48-
name: Test Results
49-
path: TestResults
29+
# Install the newman command line utility and also install the html extra reporter
30+
- name: Install newman
31+
run: |
32+
npm install -g newman
33+
npm install -g newman-reporter-htmlextra
34+
# Make directory to upload the test results
35+
- name: Make directory for results
36+
run: mkdir -p TestResults
37+
38+
# Run the POSTMAN collection
39+
- name: Run Sample Postman Collections
40+
run: |
41+
newman run collections/postman_collection.json -e collections/Test.postman_environment.json --reporters cli,htmlextra --reporter-htmlextra-export TestResults/HtmlReport.html
42+
# Upload the contents of Test Results directory to workspace
43+
- name: Output the run details
44+
uses: actions/upload-artifact@v3.1.2
45+
with:
46+
name: Test Results
47+
path: TestResults
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"id": "1ef98c2d-1595-4277-9960-70160dd8f334",
3+
"name": "Test",
4+
"values": [
5+
{
6+
"key": "asif",
7+
"value": "asif",
8+
"type": "secret",
9+
"enabled": true
10+
}
11+
],
12+
"_postman_variable_scope": "environment",
13+
"_postman_exported_at": "2023-09-06T17:27:42.291Z",
14+
"_postman_exported_using": "Postman/10.17.8-230905-0807"
15+
}

report.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const newman = require("newman");
33
newman.run(
44
{
55
collection: require("./collections/AutomationExerciseNew.postman_collection.json"),
6+
environment: require("./collections/Test.postman_environment.json"),
67

78
iterationCount: 1,
89
reporters: "htmlextra",

0 commit comments

Comments
 (0)