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。

相关推荐
Wang2012201316 小时前
芯片serdes phy vth下阈值过低,线缆干扰会识别成oob如何解决
集成测试
我送炭你添花18 小时前
Pelco KBD300A 模拟器:20.搭建pytest集成测试基础框架 + 模拟器闭环测试
python·集成测试·pytest
nangonghen19 小时前
centos 7.9安装postman v9.31.0
centos·api·postman
猿来如此呀19 小时前
集成测试自动化:用 Claude Skills 构建可靠的系统测试体系
java·集成测试
我送炭你添花20 小时前
Pelco KBD300A 模拟器:19.pytest集成测试(serial + protocol + macro)
python·log4j·集成测试
海兰20 小时前
win11下部署elastic9.0+常见问题及解决方法(续)
运维·jenkins
海鸥8121 小时前
k8s中Jenkins 配置文件「 更新不了 」
java·kubernetes·jenkins
_运维那些事儿21 小时前
GitLab&Jenkins
运维·ci/cd·gitlab·jenkins·devops
一念一花一世界21 小时前
Jenkins 太重?试试超轻量开源 CI/CD 工具 Arbess
运维·ci/cd·jenkins·arbess
liux352821 小时前
Elasticsearch 8.13.2 单机部署与配置详细指南
大数据·elasticsearch·jenkins