fix(接口自动化): 事物控制器调试特殊处理

This commit is contained in:
fit2-zhao 2021-07-21 18:56:24 +08:00 committed by fit2-zhao
parent 1670db034c
commit 7e635552e4
3 changed files with 95 additions and 35 deletions

View File

@ -258,17 +258,43 @@ export default {
if (item && item.requestResults) {
item.requestResults.forEach(req => {
req.responseResult.console = res.console;
if (resMap.get(req.resourceId)) {
if (resMap.get(req.resourceId).indexOf(req) === -1) {
resMap.get(req.resourceId).push(req);
if (req.method === 'Request') {
req.subRequestResults.forEach(subItem => {
this.reqTotal++;
let key = subItem.resourceId;
if (resMap.get(key)) {
if (resMap.get(key).indexOf(subItem) === -1) {
resMap.get(key).push(subItem);
}
} else {
resMap.set(req.resourceId, [req]);
resMap.set(key, [subItem]);
}
if (subItem.success) {
this.reqSuccess++;
} else {
this.reqError++;
}
if (subItem.startTime && Number(subItem.startTime) < startTime) {
startTime = subItem.startTime;
}
if (subItem.endTime && Number(subItem.endTime) > endTime) {
endTime = subItem.endTime;
}
})
} else {
this.reqTotal++;
let key = req.resourceId;
if (resMap.get(key)) {
if (resMap.get(key).indexOf(req) === -1) {
resMap.get(key).push(req);
}
} else {
resMap.set(key, [req]);
}
if (req.success) {
this.content.success++;
this.reqSuccess++;
} else {
this.content.error++;
this.reqError++;
}
if (req.startTime && Number(req.startTime) < startTime) {
startTime = req.startTime;
@ -276,6 +302,7 @@ export default {
if (req.endTime && Number(req.endTime) > endTime) {
endTime = req.endTime;
}
}
})
}
})
@ -449,9 +476,11 @@ export default {
.report-header {
font-size: 15px;
}
/deep/ .el-card__body {
padding: 0px;
}
.report-header a {
text-decoration: none;
}

View File

@ -531,10 +531,34 @@ export default {
this.clearDebug();
if (res && res.scenarios) {
res.scenarios.forEach(item => {
this.reqTotal += item.requestResults.length;
if (item && item.requestResults) {
item.requestResults.forEach(req => {
req.responseResult.console = res.console;
if (req.method === 'Request') {
req.subRequestResults.forEach(subItem => {
this.reqTotal++;
let key = subItem.resourceId;
if (resMap.get(key)) {
if (resMap.get(key).indexOf(subItem) === -1) {
resMap.get(key).push(subItem);
}
} else {
resMap.set(key, [subItem]);
}
if (subItem.success) {
this.reqSuccess++;
} else {
this.reqError++;
}
if (subItem.startTime && Number(subItem.startTime) < startTime) {
startTime = subItem.startTime;
}
if (subItem.endTime && Number(subItem.endTime) > endTime) {
endTime = subItem.endTime;
}
})
} else {
this.reqTotal++;
let key = req.resourceId;
if (resMap.get(key)) {
if (resMap.get(key).indexOf(req) === -1) {
@ -554,6 +578,7 @@ export default {
if (req.endTime && Number(req.endTime) > endTime) {
endTime = req.endTime;
}
}
})
}
})

View File

@ -156,7 +156,13 @@ export default {
width: 15%;
margin-left: 5px;
}
.ms-req-error {
color: #F56C6C;
}
.ms-req-success {
color: #67C23A;
}
.ms-step-debug-code {
display: inline-block;
margin: 0 5px;