fix(接口测试): 修复sub推荐断言不生效的缺陷

--bug=1013265 --user=王孝刚 [接口测试] github#13699MQTT
sub到的响应体为JSON时,无法使用JSONPath进行参数提取 https://www.tapd.cn/55049933/s/1161328
This commit is contained in:
wxg0103 2022-05-20 15:15:41 +08:00 committed by f2c-ci-robot[bot]
parent 0efd7ebbf0
commit 194adac121
1 changed files with 25 additions and 0 deletions

View File

@ -243,6 +243,7 @@ export default {
},
watch: {
message() {
this.forStatus();
this.reload();
},
'request.hashTree'() {
@ -400,6 +401,30 @@ export default {
});
}
},
forStatus() {
this.reqSuccess = true;
if (this.request.result && this.request.result.length > 0) {
this.request.result.forEach(item => {
item.requestResult.forEach(req => {
if (!req.success) {
this.reqSuccess = req.success;
}
})
})
} else if (this.request.requestResult && this.request.requestResult.length > 1) {
this.request.requestResult.forEach(item => {
if (!item.success) {
this.reqSuccess = item.success;
if (this.node && this.node.parent && this.node.parent.data) {
this.node.parent.data.code = 'error';
}
}
})
}
if (this.request.requestResult && this.request.requestResult.length > 0) {
this.response = this.request.requestResult[0];
}
},
reload() {
this.loading = true
this.$nextTick(() => {