美文网首页
newman+postman+jenkins测试

newman+postman+jenkins测试

作者: 年轻的菜鸟 | 来源:发表于2019-10-29 16:03 被阅读0次

    postman自行安装,windows的下载一个包一直点击下一步就好
    安装npm工具,检查安装是否成功

    npm -v
    

    有版本号出现代表安装成功
    然后安装newman执行

    npm install -g newman
    

    安装过程中出现失败可以执行

    npm config set strict-ssl false
    

    安装HTML类型的报告

    npm install newman-reporter-html
    

    查看是否安装newman成功,有版本号出现代表安装成功

    newman -v
    

    把postman的脚本导出来。类似叫xxx.postman_collection.json

    然后在cmd中执行并把报告放在F盘的tmp文件夹里,报告名为test.html

    newman run "C:\Users\Admin\Desktop\xxx.postman_collection.json" -r html --reporter-html-export F:\tmp\test.html
    

    或者把跑的过程打印在界面,执行

    newman run "C:\Users\Admin\Desktop\xxx.postman_collection.json" -r cli --reporter-html-export F:\tmp\test.html
    

    配置jenkins中,新建一个自有项目,然后在构建时使用对应的windows或者linux命令即可,看newman的安装环境

    image.png

    相关文章

      网友评论

          本文标题:newman+postman+jenkins测试

          本文链接:https://www.haomeiwen.com/subject/jucevctx.html