1)打开“Tests”界面,在右侧“SNIPPETS”中依次点击
Status code: Code is 200 | //请求返回状态码应该为200 | |||||
Response time is less than 200ms | //请求响应时间应该小于200ms | |||||
Response headers:Content-Type header check | //请求返回的response header中应该包含“content-type”参数 | |||||
Response body: JSON value check | //请求返回的body中,type的值应该是friends |
2)对生成的代码进行一些修改
3)send运行,Test Results中显示验证是否通过