Need help with writing test cases for such data in body

Hi All,

I also need some help to create some test cases where my url is fetching data in such form:

Group:[
{
“element”:{
“id”: “ABC”,
“name: :ABC”;
“ref”: 1
},
“rateplan”:[
{
“element”:{
“id”: “SAM”,
“name”: “XYZ”,
“ref”: 1000
},
“duration”:{
“type”: “Month”,
“amount”: 36
};
“category”: “Standard”,
“type”: “Postpaid”,
"price: [
{
“type”: “Month”,
“amount”: 1000,
},

there are various layers of data within elements.

any help is appreciated.

thanks!!

Maybe this is not the answer you want to hear, but in order to make such assertions you need to get familiar with nested objects and arrays in JavaScript.

Maybe this can be a starting point: https://hackernoon.com/accessing-nested-objects-in-javascript-f02f1bd6387f

Once you have understood how that works and how you can access different properties, I am sure you will find creating assertions will be relatively easy.