if(responseCode.code === 200){
tests["请求正常"] = responseCode.code === 200;
}else{
tests["请求正常异常【状态码为:200】"] = responseCode.code === 200;
}
try {
var responseJSON = JSON.parse(responseBody);
if(responseJSON.code !== 200){
tests["业务错误【"+responseJSON.message+"】"] = responseJSON.code === 200;
}
else{
tests["业务正常"] = responseJSON.code === 200;
tests["t---【"+responseJSON.data.t+"】"] = true;
//只有登录和获取header值才需要下面的三个赋值
postman.setEnvironmentVariable('t', responseJSON.data.t);
postman.setEnvironmentVariable('s', responseJSON.data.s);
}
}
catch (e) {
}
if(responseTime < 200){
tests["响应小于200毫秒【"+responseTime+"毫秒】"] = responseTime < 200;
}else{
tests["响应大于200毫秒【"+responseTime+"毫秒】"] = responseTime < 200;
}