newman: Html report is not generated with the new version 3.9.X

Html report is not generated with the new version 3.9.X Since I’ve update to the new version, the report in html is not generated. Whith the version 3.8.3 it works fine.

Version and environment information: –>

  1. Newman Version: 3.9.X
  2. OS details (type, version, and architecture): Windows
  3. Are you using Newman as a library, or via the CLI? as a library
  4. Did you encounter this recently, or has this bug always been there: recently, since I’ve install the new version of newman 3.9.X. With the version 3.8.3 it works fine.
  5. Expected behaviour: create report
  6. Command / script used to run Newman:
#!/bin/bash
ENVIRONMENT=$1
TEST=$2
FILE=$3
newman run collections/${FILE} --disable-unicode --color --insecure -x -e environments/${ENVIRONMENT}.json --timeout-request 80000 --reporters cli,html,json,junit --reporter-json-export output/report-${ENVIRONMENT}-${TEST}.json --reporter-junit-export output/report-${ENVIRONMENT}-${TEST}.xml --reporter-html-export output/report-${ENVIRONMENT}-${TEST}.html
cat output/report-${ENVIRONMENT}-${TEST}.html |grep Assertions | sed -e 's/<[^>]*>/ /g' | awk '{print $1" " ($2-$3)*100 / $2 "%  "$2" "$3 }'

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (2 by maintainers)

Most upvoted comments

Awesome, glad it solved the problem.

There is also a section on the Newman README that references then need to install this reporter separately. This doesn’t, however, mention that you would need to do this for V4. That’s something that can be updated.

https://github.com/postmanlabs/newman#html-reporter

Just as a personal promotion thing and it’s obviously your choice - There is another version of the HTML reporter that I maintain, which has a few additional features in there. 😄

https://github.com/DannyDainton/newman-reporter-htmlextra

Did you also install the html reporter globally with V4 of Newman?

npm i -g newman-reporter-html

The html reporter was separated out into its own project in V4 so you would also need to install this in order to use that reporter.

Would you be able to try that please and see if that works?

I had a thought, checked the documentation, and identified the cause (in my case anyway).

As per the Newman documentation, all options are to be listed after the collection: newman run <collection-file-source> [options] Stating the desired reporters before the collection will be ignored by versions after v3.8.3.

Works with Newman v3.8.3 and earlier: newman run -r cli,junit my_collection.postman_collection.json

Works with Newman v3.9.4: newman run my_collection.postman_collection.json -r cli,junit

The findings above have been tested in the following environments:

macOS High Sierra v10.13.4 Node v8.9.1 Newman v3.9.4

Docker 18.03.1-ce Base centos7 Node v7.10.1 Newman v3.9.4