fix(误报库): 修复场景调试报告展示页面没有误报tab的问题

--bug=1009861 --user=宋天阳 【接口测试】场景执行结果,没有显示误报tab
https://www.tapd.cn/55049933/s/1096145
This commit is contained in:
song-tianyang 2022-01-22 14:31:02 +08:00 committed by xiaomeinvG
parent 702c2f3cb3
commit 15a3227135
2 changed files with 13 additions and 5 deletions

View File

@ -147,10 +147,10 @@ public class ApiScenarioReportStructureService {
*/
for (StepTreeDTO step : dtoList) {
if (step.getValue() != null) {
if (step.getValue().getError() > 0 || !step.getValue().isSuccess()) {
isError.set(isError.longValue() + 1);
} else if (StringUtils.isNotEmpty(step.getErrorCode())) {
if (StringUtils.isNotEmpty(step.getErrorCode())) {
isErrorReport.set(isErrorReport.longValue() + 1);
}else if (step.getValue().getError() > 0 || !step.getValue().isSuccess()) {
isError.set(isError.longValue() + 1);
}
} else if (CollectionUtils.isNotEmpty(step.getChildren())) {
AtomicLong isChildrenError = new AtomicLong();
@ -175,8 +175,7 @@ public class ApiScenarioReportStructureService {
scenarioCalculate(step.getChildren(), error, errorReportCode);
if (error.longValue() > 0) {
scenarioError.set((scenarioError.longValue() + 1));
}
if (errorReportCode.longValue() > 0) {
} else if (errorReportCode.longValue() > 0) {
errorReport.set((errorReport.longValue() + 1));
}
} else if (step.getValue() != null) {

View File

@ -40,6 +40,13 @@
ref="failsTree"
/>
</el-tab-pane>
<el-tab-pane name="errorReport" v-if="content.errorCode > 0">
<template slot="label">
<span class="fail">{{ $t('error_report_library.option.name') }}</span>
</template>
<ms-scenario-results v-on:requestResult="requestResult" :console="content.console"
:treeData="fullTreeNodes" ref="errorReportTree"/>
</el-tab-pane>
<el-tab-pane name="console">
<template slot="label">
<span class="console">{{ $t('api_test.definition.request.console') }}</span>
@ -192,6 +199,8 @@ export default {
filter(index) {
if (index === "1") {
this.$refs.failsTree.filter(index);
} else if (this.activeName === "errorReport") {
this.$refs.errorReportTree.filter("errorReport");
}
},
handleClick(tab, event) {