Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Decimal points not showing in the reports response body if they are all zeroes #280

Open
edwardjong opened this issue Oct 19, 2020 · 4 comments
Labels
state: help-wanted Extra assistance needed type: bug Something isn't working

Comments

@edwardjong
Copy link

edwardjong commented Oct 19, 2020

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:
image

CSV output
image
You can see the difference between HTML and CSV output

Investigating the HTML file:
Google Chrome - Inspect - Sources
image
The zeroes are in the file, but the formatting is NOT ok

Version and Platform Information:

  • newman version 5.0.0

  • newman-reporter-htmlextra version 1.19.4

  • OS 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.

@edwardjong edwardjong added the type: bug Something isn't working label Oct 19, 2020
@edwardjong edwardjong changed the title Browser does not display decimals behind dec. point if zeroes, they are in the Response Body. htmlextra version 1.19.4 Browser does not display decimals behind dec. point if zeroes, they are in the Response Body. Oct 19, 2020
@edwardjong edwardjong changed the title htmlextra version 1.19.4 Browser does not display decimals behind dec. point if zeroes, they are in the Response Body. htmlextra version 1.19.4 Browser does not display decimals behind dec. point if zeroes, they are in the Response Body. Oct 19, 2020
@edwardjong
Copy link
Author

Inspect sources

@edwardjong edwardjong reopened this Oct 19, 2020
@edwardjong edwardjong changed the title htmlextra version 1.19.4 Browser does not display decimals behind dec. point if zeroes, they are in the Response Body. htmlextra version 1.19.4 Browser does not display decimals behind dec. point if zeroes, they are in the Response Body. HELP !!! Oct 19, 2020
@DannyDainton DannyDainton changed the title htmlextra version 1.19.4 Browser does not display decimals behind dec. point if zeroes, they are in the Response Body. HELP !!! [BUG] Decimal points not showing in the reports response body if they are all zeroes Oct 19, 2020
@DannyDainton
Copy link
Owner

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.

@praveendvd
Copy link
Contributor

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 ?

@DannyDainton
Copy link
Owner

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 😔

@DannyDainton DannyDainton added the state: help-wanted Extra assistance needed label Dec 30, 2021
@DannyDainton DannyDainton changed the title [BUG] Decimal points not showing in the reports response body if they are all zeroes [Bug] Decimal points not showing in the reports response body if they are all zeroes Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: help-wanted Extra assistance needed type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants