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。

相关推荐
冷凝娇11 小时前
【Postman】2026总结
测试工具·postman
QH139292318802 天前
Keysight N9917B N9918B手持式综合微波分析仪
网络·科技·嵌入式硬件·集成测试·信息与通信
回眸不遇2 天前
类型的区别和应用场景 nested 每个对象独立存储为隐藏的子文档 适合存储数组 查询的时候有特定的语法 nested查询 且字段要 ...
运维·jenkins
X1A0RAN3 天前
容器化部署 Jenkins 教程
运维·docker·jenkins
BullSmall3 天前
jenkins 全局工具变更后,构建的任务为什么没有刷新过来
运维·jenkins
BullSmall3 天前
报错 libatomic.so.1: No such file or directory
jenkins
Wang201220133 天前
V93000机台(如L、S、C、A、EXA Scale系列)介绍对比
集成测试
ji_shuke3 天前
从零深入:基于 Playwright + Pytest + Allure 的企业级 Web 端到端自动化测试框架实战
前端·自动化测试·docker·jenkins·pytest·allure·playwright
降临-max4 天前
Postman----接口自动化
软件测试·功能测试·自动化·postman
测试秃头怪4 天前
postman接口测试详解
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman