测试响应码状态是否为200:
pm.test("Status test", function () { pm.response.to.have.status(200); });
还可以使用pm.expect语法进行拓展pm.test("Status test", function () {pm.expect(pm.response.code).to.equal(200);pm.expect(pm.response.responseTime).to.below(200);
}];
检查响应主体中是否包含某字符串:
pm.expect(res.date[0].id).to.eql(1);
});