Postman 断言对应脚本的解释

接口返回json:

{
    "code": "000000",
    "msg": "成功",
    "data": {
        "userId": 445962,
        "userName": "13719654762",
        "iconUrl": null,
        "token": "5ea0bc3d-9f8f-47ff-826e-02e7e28563e1"
    }
}

1.检查状态码等于200

2.检查响应中包含string

3.检查JSON某字段值


4.contains string 断言respoonse body中包含string

posted @ 2020-07-02 17:11  不放弃自己  阅读(236)  评论(0编辑  收藏  举报