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

View File

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

View File

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