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。

相关推荐
lisanmengmeng1 天前
搭建elk环境并接入frostmourne,实现监控报警效果(一)
运维·elk·jenkins
摸摸芋2 天前
postman(ai篇)
测试工具·postman
爱编程的Zion3 天前
Jenkins 从 0 到 1 学习笔记
笔记·学习·jenkins
凤山老林4 天前
高保真集成测试:Spring Boot 结合 Testcontainers 的工程落地
spring boot·后端·集成测试
JavaDog程序狗4 天前
【指南】uni-app微信小程序多环境CI-CD完全指南
ci/cd·uni-app·jenkins
heimeiyingwang6 天前
【GitOps·入门篇】工具生态:ArgoCD、Flux、Jenkins X 对比选型
jenkins·flux·argocd·gitops
骇客野人6 天前
基于Nginx+Eureka+Apollo+Jenkins+SpringBoot Web系统分布式部署方案
nginx·eureka·jenkins
中才实用7 天前
Jenkins自动化部署
运维·自动化·jenkins
小小尚@8 天前
AE脚本-AE Actions v1.1.8 操作动作记录器
开发语言·前端·javascript·jupyter·postman
Wang201220138 天前
smarttest8 x-mode的原理是什么?
集成测试