Skip to content

Commit 5d247ef

Browse files
committed
机器学习零代码测试:新增对状态码趋势的分析,匹配删除等只能首次成功后续失败的场景
1 parent 69eb1c0 commit 5d247ef

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

apijson/JSONResponse.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@ var JSONResponse = {
364364
var tThrw = target.throw;
365365
var rThrw = real.throw;
366366

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

369-
var exceptions = target.exceptions || [];
370370
var find = null;
371371
for (var i = 0; i < exceptions.length; i++) {
372372
var ei = exceptions[i];
@@ -418,6 +418,14 @@ var JSONResponse = {
418418
real.throw = rThrw;
419419
}
420420

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

js/main.js

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

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

0 commit comments

Comments
 (0)