Forum Discussion
I'm running 1.5 maintenance build, and I have several hundred assertions setup to NOT include the decimal point. For example, I'm asserting the value "20" comes back for a dollar amount, but now the response is "20.0" so the assertion is failing (this is causing 300+ tests to show false failures). Could we please create a happy medium here and allow an option to display or remove unnecessary decimals? Thanks.
Hi austino,
That fact that it is asserting 20 is the error. In the actual response you receive, viewable in the 'Raw' tab. the actual value will probably be 20.0, while in the JSON tab its been displayed as 20. When the fix was made I also had to go through the pain of updating over 1000+ test cases and each test had multiple assertions for decimal values.
The whole purpose of this fix is to make sure that what is returned from the API is the actual value been asserted (tested).
The problem lies with the older Ready API build that was used, in which when the original assertion was created it was taking the incorrect 20 value instead of 20.0 which is the value been returned in the API response.
I welcome any input/opinion from Smartbear on this issue.
Regards,
- austino9 years agoContributor
JSON can return just an integer, (20), it doesn't have to be (20.0). What they did with your fix was just added .0 to the end of everything, so that's why my assertions broke. Before this update, the raw response and the outline were returning (20)
- blade9 years agoOccasional Contributor
If I use another tool like postman, the Raw Response is always displaying 0.0 for me. This is the value that I assert against. In the JSON View (Pretty Print as they call it) in postman it displays as 0. This currently matches with Ready API 1.5.0 behaviour. We could wait for a reply from smartbear and see if it would be possible to have a config setting in preferences to assert against the Raw Response or the JSON View.
Related Content
- 8 months agoMW_Didata