My question: Hi all,
I want to verify around 500 fields and their values (assert expected values to actual values) in response.
I’ve already tried:
I have tried ajv tests and I do get failure mgs however the test result does not tell me which field(s) did not match the expected value.
The test result tells me on a high level that the assertion failed and gives me the whole response (which is not helpful as there are 500 fields).
Is there a way/test script that will pin-point/tell me where exactly the test failed eg. the field name which had incorrect value
Details (like screenshots):
Here, if the AppNumber is incorrect (expected=12345 <> actual=1234), I get Failed mgs with the entire response body instead of the Field name.
ResponceBody like:
{
“Application”: {
“AppNumber”: “12345”,
“App”: true,
“Apptravel”: true,
“ABC”: [
{
“ABCType”: “string”,
“Names”: “string”,
“familyName”: “string”,
“otherNames”: “string”,
“gender”: “string”,
“dob”: “2021-12-08”
}
],
"AlertApp": [
{
"AlertId": "string",
"AlertAction": "string",
"AlertCreatedDate": "string",
"AlertNumber": "string"
}
],
"Warnings": [
{
"warningId": "string",
"warningType": "string"
}
]
},
“AnotherArray1”: [
{
“SomeFields1”: “Test A User”,
“SomeFields2”: true,
“AnotherArrayhere”: [
“ABC road”
],
"AnotherArray2": {
"SomeMoreFields": "2021-12-08"
},
"SomeMoreDetails": {
"Details": {
"unableCheck": "string"
},
"medicalDetails": {
"isVisitMedicalTreatment": true
},
"TravelInfo": {
"studyStartDate": "2021-12-08"
}
},
"TravelDetails": [
{
"startDate": "2021-12-08",
"endDate": "2021-12-08"
}
],
"movements": [
{
"travelDocNumber": "string",
"movementType": "Arrived",
"date": "2021-12-08",
"embarkationPort": "string",
"disembarkationPort": "string"
}
],
"citizenships": [
{
"citizenshipCountry": "string",
"hasTravelDocument": true,
"nationalIdNumber": "string"
}
],
"countriesVisited": [
{
"country": "string",
"durationInDays": 0
}
],
"detentions": [
{
"startDate": "2021-12-08",
"endDate": "2021-12-08",
"country": "string",
"reason": "string"
}
],
"alerts": [
{
"alertId": "string",
"alertCreatedDate": "string",
"alertNumber": "string"
}
],
"priorTravels": [
{
"TravelDuration": 0,
"priorTravelDetails": {
"payAndSkillLevel": {
"annualSalary": 0
}
},
"priorResult": {
"riskRating": "string",
"profiledBy": "string",
"RelatedDate": "string",
"rulesRelated": [
"string"
]
},
"priorApps": [
{
"firstName": "string",
"middleNames": "string",
"surname": "string"
}
]
}
],
"TravelHistories": [
{
"clientID": 0,
"dateStarted": "2021-12-08",
"dateEnded": "2021-12-08"
}
]
}
]
}