postman学习:如何写断言

第1课:如何写断言

测试地址 :
http://www.v2ex.com/api/topics/hot.json
请求方式:
get
tests['状态码必须是200'] = responseCode.code===200;
var res=JSON.parse(responseBody);
console.log(res.length);
tests['必须返回10条记录']=res.length===10;

得到两个ok

第2课:sendbox

猜你喜欢

转载自www.cnblogs.com/polax/p/12206605.html