Postman + Jenkins + Report 集成测试

  1. 安装nodejs

下载nodejs包

$ cd /usr/bin

$ sudo ln -s /local/mnt/workspace/tools/node-v23.5.0-linux-x64/bin/npm npm

$ sudo ln -s /local/mnt/workspace/tools/node-v23.5.0-linux-x64/bin/node node

  1. 安装newman

通过npm安装newman

$ npm install -g newman --registry https://registry.npmmirror.com/

$ npm install -g newman-reporter-html --registry https://registry.npmmirror.com/

$ npm install -g newman-reporter-htmlextra --registry https://registry.npmmirror.com/

$ cd /usr/bin

$ sudo ln -s /local/mnt/workspace/tools/node-v23.5.0-linux-x64/bin/newman newman

Note: 安装newman-reporter-htmlextra生成更加好看的报告。

  1. 启动Jenkins

启动Jenkins后如果测试报告的css样式丢失,则需要在启动Jenkins是增加如下property。

java -Dhudson.model.DirectoryBrowserSupport.CSP= -jar jenkins.war --httpPort=8172

  1. 怎样执行postman collection

在Jenkins job configuration页面,添加shell script

newman run <collection_file> -e <environment_file> -r cli,htmlextra --reporter-htmlextra-export report/test_report.html

  1. 在Jenkins Job中展示html报告

在Jenkins job configuration页面,添加Post-build Actions -> Publish HTML reports。

相关推荐
林开落L1 天前
【项目实战】博客系统完整测试报告(含自动化+性能测试)
python·功能测试·jmeter·自动化·postman·性能测试·xmind
HoneyMoose2 天前
Postman 测试 API 如何上传文件
测试工具·postman
safestar20122 天前
ES批量写入性能调优:BulkProcessor 参数详解与实战案例
java·大数据·运维·jenkins
Tangcan-2 天前
博客系统测试报告
功能测试·测试工具·postman
zncxCOS2 天前
【ETestDEV5教程30】ICD操作之信号组操作
python·测试工具·测试用例·集成测试
k7Cx7e3 天前
Thinkphp6在Postman中接收不到Post参数的解决办法
测试工具·postman
专吃海绵宝宝菠萝屋的派大星3 天前
使用postman测试自己编写的mcp服务
测试工具·lua·postman
A__tao3 天前
Elasticsearch Mapping 一键生成 Proto 文件(支持嵌套 + 注释过滤)
大数据·elasticsearch·jenkins
小叶lr3 天前
jenkins打包前端样式丢失/与本地不一致问题
运维·前端·jenkins