1 定义了一个接口 GET /benefits
2 在“后执行操作加入”自定义脚本“
apt.test("响应码为 200", function () {
apt.response.to.have.status(200);
});
apt.test("响应json的message字段值为'ok'", function () {
var jsonData = apt.response.json();
apt.expect(jsonData.message).to.eql("ok0");
});
3 “自动化测试”,“API 管理”里执行 用例,都得到错误的断言统计。
自定义脚本的第 2 个断言是失败,所以应该是断言失败 1 个,但“断言失败数”显示 2 个。
已知bug 在优化中