mardi 23 mars 2021

Alternative to Schema testing in postman?

I am creating a regression test suite within postman for API. That means, if test fails we need to know what actually failed. With schema testing via ajv we get only "false expected to be true" error which is not good for error handling since it doesn't tell you why it has failed.

So I was looking for a way to test every field and value of the JSON response. See example JSON below.

{
"Id": 13706773,
"CompanyCode": "HCPBA02",
"CompanyStreet": "aaa",
"CompanyHouseNumber": "2002",
"CompanyHouseNumberAddition": "A2002",
"CompanyPostalCode": "1111 TA",
"CompanyCity": "ttt",
"CompanyName": "HCPB",
"CompanyMailBoxNumber": "12",
"CompanyMailPostalCode": "1111 AT",
"CompanyMailCityTown": "aaa",
"CompanyTotalWorkAmount": "40",
"NumberChamberOfCommerce": null,
"VatNumber": null,
"CompanyCountry": null,
"CompanyEstablishmentCountry": "NL"
}

Validation has proceeded for every field and value. What possibilities do I have to check if every field is having the right value. what possibilities do I have to check every field specifically? What possibilities do I have for error handling? (If something fails I want it to tell me what actually failed)

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire