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。

相关推荐
jason成都4 小时前
elasticsearch部署时创建用户密码
大数据·elasticsearch·jenkins
linuxcpp_5 小时前
postman历史版本下载
postman
qq_3482318512 小时前
Spring Boot 项目各模块整合
运维·jenkins
测试老哥1 天前
Postman接口测试基本操作
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman
TinpeaV1 天前
Elasticsearch8(ES)保姆级菜鸟入门教程
大数据·spring boot·elasticsearch·搜索引擎·全文检索·postman
西江649761 天前
【个人博客系统—测试报告】
python·功能测试·jmeter·pycharm·postman
忍冬行者1 天前
基于docker安装jenkins+gitlab+harbor
docker·gitlab·jenkins
卓码软件测评2 天前
CNAS软件测试机构:【Postman集合从接口组织到自动化测试套件的过程】
网络·测试工具·性能优化·测试用例·压力测试·postman
遇见火星2 天前
主流CI/CD工具对比分析!
ci/cd·gitlab·jenkins·云效
成为你的宁宁2 天前
【Jenkins 参数化构建实战指南:基于机器环境与插件配置,详解 tag 标签管理、commit 修订号应用、版本切换及回退全流程】
git·gitlab·jenkins·参数化构建