How to write a nested test case in postman?

1k Views Asked by At

For Example, if below is my response:

{
    "rule":"1001",
    "fixedResponse":"101JOB0011102JOB0012"
}

Based on fixedResponse field value, can I create a test case like a function within a function for each job validation?

pm.test("Validate Resposne"),function(){
    if(pm.response.json().fixedResponse.inculde("101JOB"))
        pm.test("101 JOB vlaidaiton"),function(){
    }
}
0

There are 0 best solutions below