**strong text*I have an endpoint and I want to create tests in postman with the following scenarios:
idPessoa field with: letter https://{{integrationURL}}/telefones/api/telefones?idPessoa=A
idPessoa field with: blank https://{{integrationURL}}/telefones/api/telefones?idPessoa=
For any of these scenarios the expected result is:
“error”: {
“errorCode”: “INT-VAL003”,
“message”: “Erro ao validar os dados de entrada.”,
“errors”: [
{
“schemaPath”: “#/properties/idPessoa/type”,
“params”: {
“type”: “number”
},
“message”: “deve ser um número”
}
]
}
}
The only test I’ve done at the moment for this case using pm is:
https://{{integrationURL}}/telefones/api/telefones?idPessoa=1444
pm.test(“Status code is 200”, function () {
pm.response.to.have.status(200);
});
pm.test(“Search by existing ID and validates if the id in the response is even informed”, function () {
var jsonData = pm.response.json();
pm.expect(jsonData.content[0].idPessoa).to.eql(1444);
});
*