Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
newman: postman/newman@1.0.0
Use newman
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Sample example description.
1
2
3
4
5
6
7
version: '2.1'
orbs:
newman: postman/newman@1.2.3
workflows:
use-my-orb:
jobs:
- newman/<job-name>
Running a collection file with newman
1
2
3
4
5
6
7
8
9
10
11
version: '2.1'
orbs:
newman: postman/newman@1.0.0
jobs:
newman-collection-run:
executor: newman/postman-newman-docker
steps:
- checkout
- newman/newman-run:
collection: ./collection.json
workflows: null
Running a collection file with an environment and timeout config
1
2
3
4
5
6
7
8
9
10
11
12
13
version: '2.1'
orbs:
newman: postman/newman@1.0.0
jobs:
newman-collection-run-env-timeout:
executor: newman/postman-newman-docker
steps:
- checkout
- newman/newman-run:
collection: ./collection.json
environment: ./environment1.postman_environment.json
timeout: '1000'
workflows: null
Checkout repository, run Newman, and export results to the workspace.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
additional-options | Additional options for newman run like --bail, --suppress-exit-code, client certificates and reporters, etc
References
https://github.com/postmanlabs/newman#newman-run-collection-file-source-options
https://github.com/postmanlabs/newman#ssl-client-certificates
https://github.com/postmanlabs/newman#reporters
| No | '' | string |
collection | Collection file path or URL | Yes | - | string |
delay-request | Delay between requests (milliseconds) | No | '' | string |
environment | Environment file path or URL | No | '' | string |
executor | An executor to use with the run job. | No | postman-newman-docker | executor |
export-collection | File path where Newman will output the final collection file before completing a run | No | '' | string |
export-environment | File path where Newman will output the final environment variables file before completing a run | No | '' | string |
export-globals | File path where Newman will output the final global variables file before completing a run | No | '' | string |
folder | Run requests within a particular folder/folders in a collection | No | '' | string |
globals | Globals file path or URL | No | '' | string |
ignore-redirects | Disable automatically following 3XX redirect responses | No | false | boolean |
insecure | Disables SSL verification checks and allows self-signed SSL certificates | No | false | boolean |
iteration-count | Number of times the collection has to be run when used in conjunction with iteration data | No | '' | string |
iteration-data | Data source (CSV) file path or URL to be used for iteration | No | '' | string |
persist-exports | Whether to persist exports from the Newman run. | No | false | boolean |
persist-workspace-path | The artifact directory, relative to persist-workspace-root, that contains Newman reports. | No | newman | string |
persist-workspace-root | The root directory for persisting Newman artifacts. | No | ~/project | string |
timeout | Time (in milliseconds) to wait for the entire collection run to complete execution | No | '' | string |
timeout-request | Time (in milliseconds) to wait for requests to return a response | No | '' | string |
timeout-script | Time (in milliseconds) to wait for scripts to complete execution | No | '' | string |
Run a Postman Collection Reference - https://github.com/postmanlabs/newman#newman-run-collection-file-source-options
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
additional-options | Additional options for newman run like --bail, --suppress-exit-code, client certificates and reporters, etc
References
https://github.com/postmanlabs/newman#newman-run-collection-file-source-options
https://github.com/postmanlabs/newman#ssl-client-certificates
https://github.com/postmanlabs/newman#reporters
| No | '' | string |
collection | Collection file path or URL | Yes | - | string |
delay-request | Delay between requests (milliseconds) | No | '' | string |
environment | Environment file path or URL | No | '' | string |
export-collection | File path where Newman will output the final collection file before completing a run | No | '' | string |
export-environment | File path where Newman will output the final environment variables file before completing a run | No | '' | string |
export-globals | File path where Newman will output the final global variables file before completing a run | No | '' | string |
folder | Run requests within a particular folder/folders in a collection | No | '' | string |
globals | Globals file path or URL | No | '' | string |
ignore-redirects | Disable automatically following 3XX redirect responses | No | false | boolean |
insecure | Disables SSL verification checks and allows self-signed SSL certificates | No | false | boolean |
iteration-count | Number of times the collection has to be run when used in conjunction with iteration data | No | '' | string |
iteration-data | Data source (CSV) file path or URL to be used for iteration | No | '' | string |
timeout | Time (in milliseconds) to wait for the entire collection run to complete execution | No | '' | string |
timeout-request | Time (in milliseconds) to wait for requests to return a response | No | '' | string |
timeout-script | Time (in milliseconds) to wait for scripts to complete execution | No | '' | string |
Official newman docker image - https://hub.docker.com/r/postman/newman
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
tag | Tag for postman/newman docker image - https://hub.docker.com/r/postman/newman/tags | No | latest | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
Newman is a collection runner for Postman. It allows you to effortlessly run and test a Postman collection.
display:
home_url: https://www.postman.com/
source_url: https://github.com/postmanlabs/newman-orb
commands:
newman-run:
description: |
Run a Postman Collection Reference - https://github.com/postmanlabs/newman#newman-run-collection-file-source-options
parameters:
additional-options:
default: ""
description: |
Additional options for newman run like --bail, --suppress-exit-code, client certificates and reporters, etc
References
https://github.com/postmanlabs/newman#newman-run-collection-file-source-options
https://github.com/postmanlabs/newman#ssl-client-certificates
https://github.com/postmanlabs/newman#reporters
type: string
collection:
description: Collection file path or URL
type: string
delay-request:
default: ""
description: Delay between requests (milliseconds)
type: string
environment:
default: ""
description: Environment file path or URL
type: string
export-collection:
default: ""
description: File path where Newman will output the final collection file before completing a run
type: string
export-environment:
default: ""
description: File path where Newman will output the final environment variables file before completing a run
type: string
export-globals:
default: ""
description: File path where Newman will output the final global variables file before completing a run
type: string
folder:
default: ""
description: Run requests within a particular folder/folders in a collection
type: string
globals:
default: ""
description: Globals file path or URL
type: string
ignore-redirects:
default: false
description: Disable automatically following 3XX redirect responses
type: boolean
insecure:
default: false
description: Disables SSL verification checks and allows self-signed SSL certificates
type: boolean
iteration-count:
default: ""
description: Number of times the collection has to be run when used in conjunction with iteration data
type: string
iteration-data:
default: ""
description: Data source (CSV) file path or URL to be used for iteration
type: string
timeout:
default: ""
description: Time (in milliseconds) to wait for the entire collection run to complete execution
type: string
timeout-request:
default: ""
description: Time (in milliseconds) to wait for requests to return a response
type: string
timeout-script:
default: ""
description: Time (in milliseconds) to wait for scripts to complete execution
type: string
steps:
- run: |
newman run << parameters.collection >> <<# parameters.environment >>--environment << parameters.environment >><</ parameters.environment >> <<# parameters.globals >>--globals << parameters.globals >><</ parameters.globals >> <<# parameters.iteration-count >>--iteration-count << parameters.iteration-count >><</ parameters.iteration-count >> <<# parameters.iteration-data >>--iteration-data << parameters.iteration-data >><</ parameters.iteration-data >> <<# parameters.folder >>--folder << parameters.folder >><</ parameters.folder >> <<# parameters.export-environment >>--export-environment << parameters.export-environment >><</ parameters.export-environment >> <<# parameters.export-globals >>--export-globals << parameters.export-globals >><</ parameters.export-globals >> <<# parameters.export-collection >>--export-collection << parameters.export-collection >><</ parameters.export-collection >> <<# parameters.timeout >>--timeout << parameters.timeout >><</ parameters.timeout >> <<# parameters.timeout-request >>--timeout-request << parameters.timeout-request >><</ parameters.timeout-request >> <<# parameters.timeout-script >>--timeout-script << parameters.timeout-script >><</ parameters.timeout-script >> <<# parameters.insecure >>--insecure<</ parameters.insecure >> <<# parameters.ignore-redirects >>--ignore-redirects<</ parameters.ignore-redirects >> <<# parameters.delay-request >>--delay-request << parameters.delay-request >><</ parameters.delay-request >> << parameters.additional-options >>
executors:
postman-newman-docker:
description: Official newman docker image - https://hub.docker.com/r/postman/newman
docker:
- image: postman/newman:<<parameters.tag>>
parameters:
tag:
default: latest
description: Tag for postman/newman docker image - https://hub.docker.com/r/postman/newman/tags
type: string
jobs:
run:
description: |
Checkout repository, run Newman, and export results to the workspace.
executor: << parameters.executor >>
parameters:
additional-options:
default: ""
description: |
Additional options for newman run like --bail, --suppress-exit-code, client certificates and reporters, etc
References
https://github.com/postmanlabs/newman#newman-run-collection-file-source-options
https://github.com/postmanlabs/newman#ssl-client-certificates
https://github.com/postmanlabs/newman#reporters
type: string
collection:
description: Collection file path or URL
type: string
delay-request:
default: ""
description: Delay between requests (milliseconds)
type: string
environment:
default: ""
description: Environment file path or URL
type: string
executor:
default: postman-newman-docker
description: An executor to use with the run job.
type: executor
export-collection:
default: ""
description: File path where Newman will output the final collection file before completing a run
type: string
export-environment:
default: ""
description: File path where Newman will output the final environment variables file before completing a run
type: string
export-globals:
default: ""
description: File path where Newman will output the final global variables file before completing a run
type: string
folder:
default: ""
description: Run requests within a particular folder/folders in a collection
type: string
globals:
default: ""
description: Globals file path or URL
type: string
ignore-redirects:
default: false
description: Disable automatically following 3XX redirect responses
type: boolean
insecure:
default: false
description: Disables SSL verification checks and allows self-signed SSL certificates
type: boolean
iteration-count:
default: ""
description: Number of times the collection has to be run when used in conjunction with iteration data
type: string
iteration-data:
default: ""
description: Data source (CSV) file path or URL to be used for iteration
type: string
persist-exports:
default: false
description: Whether to persist exports from the Newman run.
type: boolean
persist-workspace-path:
default: newman
description: The artifact directory, relative to persist-workspace-root, that contains Newman reports.
type: string
persist-workspace-root:
default: ~/project
description: The root directory for persisting Newman artifacts.
type: string
timeout:
default: ""
description: Time (in milliseconds) to wait for the entire collection run to complete execution
type: string
timeout-request:
default: ""
description: Time (in milliseconds) to wait for requests to return a response
type: string
timeout-script:
default: ""
description: Time (in milliseconds) to wait for scripts to complete execution
type: string
steps:
- checkout
- newman-run:
additional-options: << parameters.additional-options >>
collection: << parameters.collection >>
delay-request: << parameters.delay-request >>
environment: << parameters.environment >>
export-collection: << parameters.export-collection >>
export-environment: << parameters.export-environment >>
export-globals: << parameters.export-globals >>
folder: << parameters.folder >>
globals: << parameters.globals >>
ignore-redirects: << parameters.ignore-redirects >>
insecure: << parameters.insecure >>
iteration-count: << parameters.iteration-count >>
iteration-data: << parameters.iteration-data >>
timeout: << parameters.timeout >>
timeout-request: << parameters.timeout-request >>
timeout-script: << parameters.timeout-script >>
- persist_to_workspace:
paths:
- << parameters.persist-workspace-path >>
root: << parameters.persist-workspace-root >>
when: << parameters.persist-exports >>
examples:
example:
description: |
Sample example description.
usage:
version: "2.1"
orbs:
newman: postman/newman@1.2.3
workflows:
use-my-orb:
jobs:
- newman/<job-name>
running-collection:
description: Running a collection file with newman
usage:
version: "2.1"
orbs:
newman: postman/newman@1.0.0
jobs:
newman-collection-run:
executor: newman/postman-newman-docker
steps:
- checkout
- newman/newman-run:
collection: ./collection.json
workflows: null
running-collection-with-env-timeout:
description: Running a collection file with an environment and timeout config
usage:
version: "2.1"
orbs:
newman: postman/newman@1.0.0
jobs:
newman-collection-run-env-timeout:
executor: newman/postman-newman-docker
steps:
- checkout
- newman/newman-run:
collection: ./collection.json
environment: ./environment1.postman_environment.json
timeout: "1000"
workflows: null