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。

相关推荐
workflower15 小时前
人机交互部分OOD
运维·人工智能·自动化·集成测试·人机交互·软件需求
QH139292318801 天前
KEYSIGHT N9030B PXA信号/频谱分析仪
科技·嵌入式硬件·集成测试
小陈的进阶之路2 天前
postman-mcp-server
测试工具·lua·postman
踏着七彩祥云的小丑2 天前
面试——测试模型
集成测试
终端行者2 天前
Jenkins 流水线 Pipeline 声明式语法基础 入门----上
运维·jenkins
终端行者2 天前
Jenkins流水线Pipeline声明式语法基础入门----下
运维·jenkins·cicd
lifewange2 天前
Jenkins Windows MSI 安装包完整安装教程
windows·servlet·jenkins
marsh02062 天前
35 openclawCQRS模式应用:分离读写操作提升性能
运维·ai·jenkins·编程·技术
MegaDataFlowers3 天前
基于EasyCode插件的SpringBoot和Mybatis框架快速整合以及PostMan的使用
spring boot·mybatis·postman