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。

相关推荐
honder试试5 小时前
Elasticsearch(es)在Windows系统上的安装与部署(含Kibana)
windows·elasticsearch·jenkins
牛奶咖啡135 小时前
CI/CD——在jenkins中使用pipeline方式自动化构建java项目jpress
ci/cd·自动化·jenkins·pipeline是什么·pipeline有啥用·pipeline适用场景·pipeline使用示例
Flittly8 小时前
【日常小问】解决 Jenkins 部署 Spring Cloud 微服务到 Docker 容器启动失败的问题
运维·笔记·docker·微服务·jenkins
川石课堂软件测试21 小时前
软件测试|常见面试题整理
数据库·python·jmeter·mysql·appium·postman·prometheus
落魄实习生1 天前
Jenkins安装及使用
运维·jenkins
玄尺1 天前
jenkins安装和使用
运维·jenkins
QH139292318801 天前
罗德与施瓦茨 FSW26 FSW43 FSW50高端信号分析仪
网络·功能测试·单元测试·集成测试·模块测试
lbb 小魔仙1 天前
DolphinDB:以“存算一体“重新定义工业时序数据的边界
开发语言·人工智能·python·langchain·jenkins
yulingfeng591 天前
Elasticsearch 分词器安装(IK+拼音)
大数据·elasticsearch·jenkins
弹简特1 天前
【精通Postman接口测试-完结】05-Postman通关收官!接口鉴权+接口加密+接口签名+Mock数据构造
测试工具·postman·接口鉴权、接口签名