接口自动化 postman+jenkins实战

一、postman接口调试,断言

选择post请求方式,输入要请求的url,传参方式以混合表单为例,选择form-data,然后将参数名称和对应的值填入参数区,点击send发送请求,在响应区即可看到返回结果。如下

接口自动化 postman+jenkins实战

二、nodejs安装及配置

 下载nodejs,它node.js不是库,是一个运行环境或者是一个js语言解释器,newman基于nodejs开发,补充postman,生成测试报告

 安装nodejs 

安装newman

1
npm install -g newman

贴图

newman 使用

安装newman-reporter-html      npm install -g newman-reporter-html

导出postman的脚本 

 

本机调试出报告

newman run D:\test.postman_collection.json --reporters html --reporter-html-export  D:\html01.html   *绝对路径要对应

 

接口自动化 postman+jenkins实战

在D盘下会生成html报告

三、Jenkins

jenkins在Linux服务器上,需跨平台将windows上的文件传到Linux上

方式,安装pscp.exe ;属于Putty的重要组件工具之一,同时也可以单独使用,可以通过pscp.exe实现本地windows下的文件下载、上传到linux上

接口自动化 postman+jenkins实战

 

接口自动化 postman+jenkins实战

上一篇:eNSP配置静态路由


下一篇:石头人