Closed Freakishmahesh closed 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:
console.log
calls.@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:
@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?
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:
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.
@Freakishmahesh Yes, that sounds about right. Another possible option is to allow a collapsible section for responseBody, as has been requested in #712
@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
newman -v
):