postman——集合——执行集合——测试脚本——示例01——检查响应体中是否包含一个字符串

检查响应体中是否包含“金庸”:

pm.test("body matches string",function()
{
pm.expect(pm.response.text()).to.include("金庸");
});

=====================================================================

前提:

测试脚本:

失败如下所示:

原文地址:https://www.cnblogs.com/xiaobaibailongma/p/12196898.html