postman 常用断言
当前环境
- Window 10 - 64
- Postman 版本(免费版):Chrome App v5.5.2
一般断言
1、响应时长
pm.test("Response time is less than 200ms", function () {
pm.expect(pm.response.responseTime).to.be.below(200);
});
2、接口契约
2.1状态码
2.2数据格式
2.3值
常见断言示例
1、断言接口请求状态码200

2.1、断言返回text中有jwt_token

2.2、断言返回text中有success

3、断言json格式返回的状态码和message

4、断言数组返回信息

5、断言返回数据为对应全局变量


浙公网安备 33010602011771号