Skip to content

Commit

Permalink
机器学习零代码测试:新增对状态码趋势的分析,匹配删除等只能首次成功后续失败的场景
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLemon committed Jan 12, 2021
1 parent 69eb1c0 commit 5d247ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion apijson/JSONResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ var JSONResponse = {
var tThrw = target.throw;
var rThrw = real.throw;

var exceptions = target.exceptions || [];
if (rCode != tCode || rThrw != tThrw) {

var exceptions = target.exceptions || [];
var find = null;
for (var i = 0; i < exceptions.length; i++) {
var ei = exceptions[i];
Expand Down Expand Up @@ -418,6 +418,14 @@ var JSONResponse = {
real.throw = rThrw;
}

if (exceptions.length > 0 && (target.repeat || 0) <= 0 && (result || {}).code < JSONResponse.COMPARE_VALUE_CHANGE) {
return {
code: JSONResponse.COMPARE_VALUE_CHANGE,
msg: '状态码' + codeName + ' 违背首次成功、后续失败的趋势',
path: folder == null ? '' : folder
}
}

return result;
},

Expand Down
6 changes: 4 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3540,7 +3540,6 @@
+ '\nAPIJSON - C# 版: https://github.com/liaozb/APIJSON.NET '
+ '\nAPIJSON - PHP版: https://github.com/qq547057827/apijson-php '
+ '\nAPIJSON -Node版: https://github.com/kevinaskin/apijson-node '
+ '\nAPIJSON - Go 版: https://github.com/crazytaxi824/APIJSON '
+ '\nAPIJSON -Python: https://github.com/zhangchunlin/uliweb-apijson '
+ '\n感谢热心的作者们的贡献,GitHub 右上角点 ⭐Star 支持下他们吧 ^_^';
}
Expand All @@ -3561,7 +3560,7 @@
'\n\n\n## 文档 \n\n 通用文档见 [APIJSON通用文档](https://github.com/Tencent/APIJSON/blob/master/Document.md#3.2) \n### 数据字典\n自动查数据库表和字段属性来生成 \n\n' + d
+ '<h3 align="center">简介</h3>'
+ '<p align="center">本站为 APIAuto-自动化接口管理平台'
+ '<br>提供 接口和文档托管、机器学习自动化测试、自动生成文档和代码 等服务'
+ '<br>提供 接口和文档托管、机器学习自动化测试、自动生成文档和代码 等支持'
+ '<br>由 <a href="https://github.com/TommyLemon/APIAuto" target="_blank">APIAuto(前端网页工具)</a>, <a href="https://github.com/Tencent/APIJSON" target="_blank">APIJSON(后端接口服务)</a> 等提供技术支持'
+ '<br>遵循 <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache-2.0 开源协议</a>'
+ '<br>Copyright &copy; 2016-' + new Date().getFullYear() + ' Tommy Lemon<br><br></p>'
Expand Down Expand Up @@ -5067,6 +5066,9 @@
}
}
}
else {
stddObj.repeat = (stddObj.repeat || 0) + 1; // 统计重复出现次数
}

const isNewRandom = isRandom && random.id <= 0

Expand Down

0 comments on commit 5d247ef

Please sign in to comment.