现在变成了pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
看着难受死了。。。
怎么样调回旧的格式?
以下是官方文档,麻烦英文好的同学们看下,我是没找到怎么换回来
The older style of writing Postman tests relies on setting values for the special tests object. You can set a descriptive key for an element in the object and then say if it’s true or false. For example, tests["Body contains user_id"] = responsebody.has("user_id"); will check whether the response body contains the user_id string.
You can add as many keys as needed, depending on how many things you want to test for. Under the Tests tab under the response viewer, you can view your test results. The tab header shows how many tests passed, and the keys that you set in the tests variable are listed here. If the value evaluates to true, the test passed.作者: Miss_love 时间: 2017-11-1 09:52
支持调回?换回老版本吧。作者: 让测试飞起来 时间: 2017-11-15 16:40
编写邮件测试的旧风格依赖于为特殊测试对象设置值。您可以为对象中的一个元素设置一个描述性关键字,然后再声明它是否为真或假。例如,测试[“体内含有user_id”] = responsebody。有(“user_id”);将检查是否响应正文包含user_id字符串。