我正在尝试使用邮差/纽曼在Jenkins(在docker上构建)上自动测试我的API集合,
我已经成功使用了以下shell(URL是邮递员官方网站上的示例)
newman run "https://www.postman.com/collections/8a0c9bc08f062d12dcda"
但是当我将URL更改为我自己的收藏集(我将其放入git项目中)时,
url:纽曼运行“ http://localhost:8080/job/projectName/ws/pm/collection.json”
错误信息显示
+ newman run http://localhost:8080/job/projectName/ws/pm/collection.json
error: collection could not be loaded
the url "http://localhost:8080/job/xxx/ws/pm/collection.json" did not provide valid JSON data
Unexpected token '<' at 1:1
<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2Fjob%2Fmone
^
Build step 'Execute shell' marked build as failure
Finished: FAILURE
我也尝试过
url:纽曼运行“ localhost:8080 / job / projectName / ws / pm / collection.json”
,错误代码变为
error: collection could not be loaded
unable to read data from file "localhost:8080/job/projectName/ws/pm/collection.json"
ENOENT: no such file or directory, open 'localhost:8080/job/projectName/ws/pm/collection.json'
任何人都可以帮忙吗?拜托!!!
答案 0 :(得分:0)
我只是解决了问题,并且有效! 路径应为pm / collection.json http://localhost:8080/job/xxx/ws/pm/collection.json来自工作区