baloo icon indicating copy to clipboard operation
baloo copied to clipboard

Extract Response Body?

Open sachnk opened this issue 7 years ago • 1 comments

I have several test cases that perform JSON asserations. However, I need to extract specific fields from a JSON response that will be used for subsequent business logic.

How does one extract values from the response body?

sachnk avatar Oct 24 '18 21:10 sachnk

You can write your own assertion function, where you can perform the specific JSON structure assertions the way you prefer in standard Go. See this example: https://github.com/h2non/baloo/blob/master/_examples/custom_assertion/custom_test.go

h2non avatar Oct 24 '18 23:10 h2non