Open edwardjong opened 4 years ago
From what I know about Matt's CSV reporter is that he's taking the stream response and converting that to a string before adding it to the final CSV file.
That's not really what I'm doing here as I'm pretty printing the JSON response and I think that JSON.stringify()
is doing something weird with floating point numbers that end .00
I need to get some time to take a look at this closer.
From what I know about Matt's CSV reporter is that he's taking the stream response and converting that to a string before adding it to the final CSV file.
That's not really what I'm doing here as I'm pretty printing the JSON response and I think that
JSON.stringify()
is doing something weird with floating point numbers that end.00
I need to get some time to take a look at this closer.
Hi danny i looked into this , the issue is caused by JSON.parse(data) in prettyprint class. Should we be formatiing the response send by server ?
I did have a look at the and tried a few things without that being there but there are a few other issues.
That is more about decorating the reports request and response body in the correct way and could be handled differently but I don't have time to dig deeper into all the other things that could potentially break as a result of removing it 😔
When I run a Newman test with the option for an HTMLEXTRA report, I get the a html outputfile which shows the amount fields without zeroes behind the decimal point in the response body. Running the same test in Newman with the option for CSV output I DO get the zeroes.
HTML output:
CSV output You can see the difference between HTML and CSV output
Investigating the HTML file: Google Chrome - Inspect - Sources The zeroes are in the file, but the formatting is NOT ok
Version and Platform Information:
newman
version 5.0.0newman-reporter-htmlextra
version 1.19.4OS Windows 8, Version 6.3 (build 9600)
The CLI command you've used to start Newman
Newman run with HTMLEXTRA output: newman run -k "Claims-test.json" -d "Claims-data.csv" -e %env%.postman_environment.json -r htmlextra --reporter-htmlextra-logs --reporter-htmlextra-omitHeaders --reporter-htmlextra-hideRequestBody "PostApiGebruikersV1Login" --reporter-htmlextra-hideResponseBody "PostApiGebruikersV1Login"
Newman run with CSV output: newman run -k "Claims-test.json" -d "Claims-data.csv" -e %env%.postman_environment.json -r csv --reporter-csv-includeBody
Additional Context
Running the test in the Postman Collection Runner also shows me the zeroes.