I have two responses-response A and response B.
response A has the below structure
[{
name:A
age:B
channel:[{
date:“2018-07-23T00:00:00+02:00”,
to:“2018-07-23T00:00:00+02:00”
},
{
date:“2018-07-23T00:00:00+02:00”,
to:“2018-07-23T00:00:00+02:00”
}
}]
response B has the below structure
[{
name:A
age:B
channel:[{
date:“2018-07-23T00:00:00.0+02:00”,
to:“2018-07-23T00:00:00.002:00”
},
{
date:“2018-07-23T00:00:00.0+02:00”,
to:“2018-07-23T00:00:00.0+02:00”
}
}]
When I am trying to compare both the responses under test section in response B step, my test is failing as response B has “.0” extra. Please suggest how to overcome this?
Currently I am using deepcompare
pm.expect(responseA).to.have.deep.members(resposneB)
Thanks for the snippet @taehoshino
Can you please suggest if the script will be working if I use the above snippet because in my original response I will have nearly 30 to 40 arrays of channel which has date inside it.
Also should I need to build a for loop inside channel ?