I am trying to add logic that reruns the test if one of the expects failed. Here is the code structure
// if response is 200 then complete following checks
pm.test("Response is 200", () => {
pm.response.to.have.status(200);
pm.test(`test1`, () => {
// pm.expect1;
});
const resources = pm.response.data.filter(element => element.type === "typeA");
resources.forEach(resource => {
if ( //some conditions) {
pm.test(`test2`, () => {
//pm.expect2;
});
return;
}
pm.test(`test3`, () => {
// pm.expect3;
});
});
I would like to retry the exact request x times with a Y timeout between requests. How can I do that in postman. Thanks