欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

使用postman - newman生成html测试报告

程序员文章站 2022-04-10 14:37:33
...
Newman 官方文档网站:

https://learning.postman.com/docs/postman/collection-runs/command-line-integration-with-newman/

一、环境配置

1. 安装 nodejs

下载地址: http://nodejs.cn/download/

一直next即可,配置环境变量,安装成功。
使用postman - newman生成html测试报告

2. newman安装

cmd 输入以下命令,安装newman

npm install newman -g

安装完成,输入 newman -v 查看版本,检测是否安装成功

二、Postman配置

  1. 导出 collection,操作如下
    使用postman - newman生成html测试报告
    使用postman - newman生成html测试报告
    导出格式为 json 格式
    使用postman - newman生成html测试报告

三、NewMan生成html报告

  1. 执行测试用例,并生成 html 测试报告
#html要提前在目录下创建好,再执行命令
newman run xxxxx.json -r -html --reporter-html-export E:\test.html
  1. 报告生成,打开html文件查看:
    使用postman - newman生成html测试报告
相关标签: Postman