Using Newman, one can effortlessly run and test a Postman Collections directly from the command-line. Now in a task!
You can include this task in a build or release pipeline. Here's a quick 'How To'
-
Add a npm task to install Newman before execution.
-
Set a display name (eg : 'Install Newman').
-
Set
custom
as command -
As 'Command and arguments' set
install newman -g
. Note that if the task version doesn't yet support the latest Newman version, an older version can be used, e.g.install [email protected] -g
.
Configure this task as per your requirements. (see here and here for options)
Test report can be integrated in Team Services.
To do so :
- Select at least
junit
as a reporter option (others can be added). - Optionaly specify path to export junit report.
- Add a 'Publish Test Result' task, to process generated Junit report. Specify format (JUnit) and path and to xml file.
Execution is now reported with test statistics.
-
Add a npm task to install Newman-reporter-htmlextra before execution.
-
Set a display name (eg : 'Install Newman-reporter-htmlextra').
-
Set
custom
as command -
As 'Command and arguments' set
install -g newman-reporter-htmlextra
-
Select "htmlextra" from the reports list
If your tests are failing, then you will not see the results in the test tab. You can read more about it here, but to resolve that you can:
- On the task for the Postman tests mark the checkbox for Continue on Error.
- Add a Publish Test Results task and have it search for the following test file *\newman-.xml.
Realize that this will then NOT fail your pipeline because your tests failed. There is currently no documented way around this.
Following command line options are not supported:
-x
,--suppress-exit-code
-color
--ssl-client-passphrase
- None of the CLI option
- The
sslStrict
parameter is renamed assslInsecure
in order to better match with the actual behavior of the parameter: setting it totrue
will use newman--insecure
option to disable the strict SSL verification.
- None
The source to this extension is available. Feel free to take, fork, and extend.
View Notices for third party software included in this extension.
If you use a Postman Enterprise account workspace check out this task to use in a pipeline. Here's the post explaining it from the tasks author.
- Azure DevOps Services
- Team Foundation Server
We thank the following contributor(s) for this extension:
- sunmorgus
- sebcaps
- jeffpriz
- esbenbach
- Scott-Emberson
- afeblot
- okcomputer-programmer
- saekiAtBeng
- Skiepp
- ch264
- satano
- Add a review
- Post an issue on Github
- Send us an email