目的 用postman录制一个网站里的所有接口,然后为所有接口加上结果验证,最后运行所有测试用例。希望能提高接口测试效率。
步骤
安装postman
安装Postman Interceptor谷歌插件
https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo/
filter 请求 image.png
设置postman的Interceptor image.png
开始录制。在谷歌浏览器中输入https://api.ecreditpal.cn/lendingmart,则postman开始记录所有的api。
image.png
回放api image.png
把api保存至collections 为api添加测试验证 image.png
开始运行测试用例, 打开runnerimage.png 添加collection,开始运行image.png 用命令行运行测试用例 安装newman,npm install newman 将collection导出 运行测试用例,newman run test.postman_collectionimage.png