//获取返回数据 var jsondata = pm.response.json(); //判断响应时间是否小于200ms pm.test("Response time is less than 20ms", function () { pm.expect(pm.response.responseTime).to.be.below(20); }); //判断返回的数据值是否满足要求 if(jsondata.code==0) { tests["测试通过"]=true; } else{ tests["测试不通过"]=false; }
标签:tests,Postman,jsondata,接口,测试,response,pm From: https://www.cnblogs.com/wzf-Learning/p/16726106.html