testmanio / homebrew-tm

MIT License
0 stars 1 forks source link

API - Json comparison - To validate the list of keys from response body #51

Open arunrajgroot opened 2 months ago

arunrajgroot commented 2 months ago

Area -> API New Feature - Need to add support to validate the list of keys from response body Describe the bug - New feature request Version - NO Expected behaviour - Need to include response validation to validate the list of keys from response body, this need to be validated inform of number of keys expected , contains, need to restrict if additional key is included as undefined. Actual behaviour - Feature not available in current version How to Reproduce? - NO Anything else? - NO

Note: In current testman response validation is not included.

thamarai1414 commented 1 month ago

To validate the keys in response body - TO_HAVE_JSON_INSTANCE

After generating the file v - in code, it is displayed as undefined

thamarai1414 commented 3 weeks ago

Tested OK Now we can validate the keys in the response body Tested by valid, invalid, extra key, re-arrange the key structure, removing some keys in response REST_RESPONSE@restResponse.data

await expect(utils.compareJSONInstance(response.data,{ "auth_req_id": "", "result_delivery_mode": "", "user_id": "", "success": true, "transaction_link": "", "interval": 5, "request_id": "", "expires_in": 1718108160 })).toBeTruthy();

Screenshot 2024-06-11 at 6 34 04 PM Screenshot 2024-06-11 at 6 34 32 PM