Yaroslav Bres
Yaroslav Bres

Reputation: 1327

How to check if Newman tests fails programmatically?

I run postman tests on CI/CD and I need to check whether all tests were successfully passed. I find in the Newman Docs: Newman, by default, exits with a status code of 0 if everything runs well, such as without any exceptions.

If I correctly understand, this code signals, that all tests were passed? And how I can get this status code programmatically with any console tool?

Upvotes: 1

Views: 1854

Answers (1)

PDHide
PDHide

Reputation: 19989

  $argument = "run collection.json -e environment.json -k -r cli, htmlextra"
  $process = start-process newman -ArgumentList $argument -PassThru -Wait
 $process.ExitCode

Use start process

Upvotes: 1

Related Questions