gitlab php自动化测试,gitlab+newman实现自动化测试

前言

分析

通过postman+newman

使用

npm install -g newman

npm install -g newman-reporter-html

newman run examples/sample-collection.json

newman run examples/sample-collection.json -r html

# 生产报告在当前的目录下的newman内

结果截图

ef225a162d97

生成的报告

易错点

安装newman-reporter-html错误

[root@test2 sendEmail]# newman run scripts/web.postman_collection.json -r html

newman: "html" reporter could not be loaded.

run `npm install newman-reporter-html`

[root@test2 sendEmail]# npm install newman-reporter-html

npm WARN saveError ENOENT: no such file or directory, open '/SHELL/autoTest/sendEmail/package.json'

npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN enoent ENOENT: no such file or directory, open '/SHELL/autoTest/sendEmail/package.json'

npm WARN newman-reporter-html@1.0.3 requires a peer of newman@4 but none is installed. You must install peer dependencies yourself.

npm WARN sendEmail No description

npm WARN sendEmail No repository field.

npm WARN sendEmail No README data

npm WARN sendEmail No license field.

+ newman-reporter-html@1.0.3

added 13 packages from 45 contributors and audited 14 packages in 1.615s

found 1 high severity vulnerability

run `npm audit fix` to fix them, or `npm audit` for details

[root@test2 sendEmail]# npm audit fix

npm ERR! code EAUDITNOPJSON

npm ERR! audit No package.json found: Cannot audit a project without a package.json

npm ERR! A complete log of this run can be found in:

npm ERR! /root/.npm/_logs/2019-07-18T08_27_23_701Z-debug.log

问题截图

ef225a162d97

生产报告安装newman-reporter-html报错

解决办法

npm install -g newman-reporter-html

参考文档

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值