1. 断言HTTP响应状态码为200
tests["Status code is 200"]= responseCode.code ===200
2. 断言响应内容中是否包含"code":9420
tests["errcode is 0"] = responseBody.has('"errcode":0');
tests["errmsg is ok"] = responseBody.has('"errmsg":"ok"');
3. 解析响应内容,判断errcode和errmsg值
var respData = JSON.parse(responseBody)
tests["errcode is 0"]=respData.errcode === 0
tests["errmsg is ok"]=respData.errmsg === 'ok'
4. 断言响应时间是否小于200ms
tests["Response time is less than 200ms"] = responseTime < 200;