Improve Newman Documention for Custom Reports

newman
documentation
customreports
tutorial

#42

Thanks, @gopikrishna4595
It is working perfectly now.
Thanks for your help.


#43

Hi @gopikrishna4595

Just want to update one issue that I have faced with this custom report template

If something goes wrong and the test didn’t happen say for one request out of many requests present in the collection, the report generation could result in error and it wont generate the report.

For example, please consider below flow

  1. I have a POST request in my postman collection, and am trying to do a file upload using the rest endpoint

  2. I am running my collection with Newman and collection json is updated with a wrong path for the file to choose for the upload purposefully

  3. So the test can not succeed because there is no such file exist

  4. In this case test gets aborted and I see below error

  5. Hence report will not be generated . other tests in the collection might be passing/failing. we will not get information about them here

  6. This looks not happening with the default Newman report template, and it give report, summary table etc

PostManTestingApp\node_modules\newman\lib\reporters\html\index.js:65
executionId = currentExecution.id + currentExecution.response.id;
TypeError: Cannot read property ‘id’ of undefined
at C:\CloudPay Work Station\PostManTestingApp\node_modules\newman\lib\reporters\html\index.js:65:83
at C:\CloudPay Work Station\PostManTestingApp\node_modules\lodash\lodash.js:13805:16
at arrayEach (C:\CloudPay Work Station\PostManTestingApp\node_modules\lodash\lodash.js:516:11)
at Function.transform (C:\CloudPay Work Station\PostManTestingApp\node_modules\lodash\lodash.js:13804:43)
at EventEmitter. (C:\CloudPay Work Station\PostManTestingApp\node_modules\newman\lib\reporters\html\index.js:62:28)
at EventEmitter.emit (C:\CloudPay Work Station\PostManTestingApp\node_modules\eventemitter3\index.js:203:33)
at done (C:\CloudPay Work Station\PostManTestingApp\node_modules\newman\lib\run\index.js:249:29)
at C:\CloudPay Work Station\PostManTestingApp\node_modules\postman-runtime\lib\backpack\index.js:56:34
at PostmanCollectionRun._process (C:\CloudPay Work Station\PostManTestingApp\node_modules\postman-runtime\lib\runner\run.js:161:13)
at PostmanCollectionRun. (C:\CloudPay Work Station\PostManTestingApp\node_modules\postman-runtime\lib\runner\run.js:166:76)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
^

Thanks & Warm Regards
Musaffir


#44

Hi Gopi. I have replaced these files(C:\Users\sudhir_swain\node_modules\newman\lib\reporters\html) but still not able to generate colored report. Its the same black and white report I am getting. This is the command I am using

newman run C:\Users\sudhir_swain\Desktop\PostManCollections\ISPW_API_Collections.json --reporters html
Do I need to run any other command?
My node version is 6.10.0 and npm version is 3.10.10


#45

Hi Gopi. It woks fine now for me. Can we make API request color as “Green” instead of “Yellow” in passing scenario


#46

yes, you can @sudhir_swain


#47

hi I am unable to get mean time in report it is all zero (0ms). need help using gopikrishan index and template


#48

Hello guys, can someone help me im using a custom report from @tegomassria and everything is great but i want to see only Failed requests in the “Requests” collums i know its possible but have no idea how to modify the code part with request aggregations


#49

got same error and with custom reports


#50

Hi @gopikrishna4595 , used your .hbs file and the report generation is working fine. But i am getting Request body blank in the html report when it’s a POST request with Content-Type: multipart/form-data . Can you provide a fix around this?


#51

Hi @gopikrishna4595 I’ve been trying to use your files but I’m having issues to ge it working. I’m on a Mac, i created a test project and I ran:
npm install newman-reporter-html
I then replace the files index.js and template-default.hbs with yours in location:
my_test_project/node_modules/newman-reporter-html/lib

which is the place I can see these two files are living.

As soon as I do that, I start to get the error:

newman: “html” reporter could not be loaded.
run npm install newman-reporter-html

As soon as I revert back to the original files from newman-report-html it all works, but of course using the default files.

Would you be able to let me know what am I doing wrong?

Thanks
Javier4517


#52

Hi @gopikrishna4595,

Am also facing the same exact issue as javier4517 is facing

newman: “html” reporter could not be loaded.
run npm install newman-reporter-html

,please help to resolve


#53

Thank you @gopikrishna4595, I will check with downgrading Newman.
And also we are waiting for your updated file.:slight_smile:


#54

I’ve created a new version of the HTML reporter that includes a few more features. Not sure if it will help people on this thread though.


#55

@dannydainton Awesome !!! Thanks for your efforts for making the reports beautiful :clap:.


#56

Thank you.

I’d be lying if I said it was all my own work - I took a lot of the feedback from the other HTML reporters and tried to add this into a single place. Adding some functionality that was missing etc.

I would love any feedback, I have no doubt that there will be a few issues in there but I can sort these out relatively quickly.


#57

I’ve just added, as a first attempt, the console.log() statements onto my HTML reporter. This will more than likely change as a find a better way to add them directly to the requests but they are there now if anyone is interested. :slight_smile:


#58

Great work Danny, mean and clean!


#59

Thank you! Still a work in progress :grin:


#60

@dannydainton , sharing feedback : our team loved the reports, it would be nice if it has expand and collapse option for each scenarios, ( Requests section), since there are lot of requests and scrolling down and up is little tedious.


#61

Thank you. :grin:

The beauty of these reporters is that you can handle that on your side by just creating a new template.

The view you see is just the default, by creating a specific template for your context, you can display the data in a more meaningful way that reflects what you would like to see. :grin:

I kind of need to have a hard stop on styling changes to be honest, it’s impossible for me to design something that’s going to tick all boxes for every user. :pensive:

It should be a simple-ish change to add something that will fits your needs but it also allows you to not be blocked, while waiting for something from me :grin: