postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.88k stars 1.16k forks source link

HTML reports doesn't have the console output details. #763

Closed Freakishmahesh closed 7 years ago

Freakishmahesh commented 7 years ago
  1. Newman Version (can be found via newman -v):
  2. OS details (type, version, and architecture):
  3. Are you using Newman as a library, or via the CLI?
  4. Did you encounter this recently, or has this bug always been there:
  5. Expected behaviour:
  6. Command / script used to run Newman:
  7. Sample collection, and auxilliary files (minus the sensitive details):
  8. Screenshots (if applicable):
kunagpal commented 7 years ago

Hey @Freakishmahesh, welcome to the Newman GitHub issue tracker :)

At present, the following details are present in both: the console reports, and the HTML report as well:

The following details from the console output are not present in the HTML report:

kunagpal commented 7 years ago

@Freakishmahesh A quick update: With the above pull request, total run duration, total data received, and average response times have been added to the HTML report, and will be out in the next release. Please let us know if there's anything else you had in mind as well :smile:

Freakishmahesh commented 7 years ago

@kunagpal Verified and am still, not getting the messages that I give inside console.log. Ex : if(status_message=="success"){ consle.log("Passed") } else{ consle.log("FAIL") } If I get the console.log messages printed in ma reports, would be convenient. Isn't it?

kunagpal commented 7 years ago

Yes, we could consider adding a special section for console logs, where applicable. However, for your specific case, it would also make sense to convert your if-else block into a test case, like so:

// extract status_message from the response
tests["Request was successful"] = status_message === "success";

This will explicitly result in that request being marked as passed or failed, something that can be easily inferred from the reports. :smile:

Freakishmahesh commented 7 years ago

Yes. Right.! In case of printing list of names that we get in response, we might not be able to achieve with the tests[] thing. var people=jsonData.students; for(var i=0;i<=people.length;i++){ console.log(i+1+"Student name is -->:"+people[i].name); } Please correct me, if I'm wrong.

kunagpal commented 7 years ago

@Freakishmahesh Yes, that sounds about right. Another possible option is to allow a collapsible section for responseBody, as has been requested in #712

kunagpal commented 7 years ago

@Freakishmahesh Although this isn't supported by default, you can accomplish the same with custo reporters: https://www.getpostman.com/docs/postman/collection_runs/command_line_integration_with_newman#custom-reporters