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。

相关推荐
skinGap1 小时前
Jenkins设置防火墙规则允许访问本机IP端口
tcp/ip·jenkins
xiao-xiang1 小时前
jenkins-获取当前时间戳
运维·jenkins
两水先木示1 小时前
【Unity3D】Jenkins Pipeline流水线自动构建Apk
android·unity·jenkins
@解忧杂货铺1 小时前
DeepSeek接口联调(postman版)
测试工具·postman·deepseek
java 凯8 小时前
Ubuntu 上安装 Elasticsearch 7.6.0
ubuntu·elasticsearch·jenkins
tingting011910 小时前
anolis os 8.9安装jenkins
运维·jenkins
程序员小远19 小时前
Postman接口测试:postman设置接口关联,实现参数化
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman
阿里云云原生1 天前
使用 Apifox、Postman 测试 Dubbo 服务,Apache Dubbo OpenAPI 即将发布
apache·dubbo·postman
echso。。1 天前
Jenkins+gitee 搭建自动化部署
运维·gitee·自动化·jenkins
亦世凡华、2 天前
从零开始:使用Jenkins实现高效自动化部署
运维·自动化·jenkins·安装教程·基本使用