fix(接口测试): 修复执行场景报告状态显示测试中问题

--bug=1009207 --user=赵勇 【接口测试】场景编辑,调试-生成报告,测报告里,点击请求后状态变成进行中了 https://www.tapd.cn/55049933/s/1086343
This commit is contained in:
fit2-zhao 2021-12-23 17:22:03 +08:00 committed by fit2-zhao
parent f1d7a8050f
commit e6a34dd844
1 changed files with 19 additions and 24 deletions

View File

@ -35,8 +35,9 @@
</template> </template>
<ms-scenario-results <ms-scenario-results
:console="content.console" :console="content.console"
:treeData="failsTreeNodes" :treeData="fullTreeNodes"
v-on:requestResult="requestResult" v-on:requestResult="requestResult"
ref="failsTree"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="console"> <el-tab-pane name="console">
@ -91,8 +92,6 @@ export default {
content: {total: 0, scenarioTotal: 1}, content: {total: 0, scenarioTotal: 1},
report: {}, report: {},
loading: false, loading: false,
fails: [],
failsTreeNodes: [],
totalTime: 0, totalTime: 0,
isRequestResult: false, isRequestResult: false,
startTime: 99991611737506593, startTime: 99991611737506593,
@ -186,8 +185,14 @@ export default {
reset(); reset();
}); });
}, },
filter(index) {
if (index === "1") {
this.$refs.failsTree.filter(index);
}
},
handleClick(tab, event) { handleClick(tab, event) {
this.isRequestResult = false this.isRequestResult = false;
this.filter(tab.index);
}, },
exportReportReset() { exportReportReset() {
this.$router.go(0); this.$router.go(0);
@ -222,26 +227,16 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getFails(arrays) {
for (let i = 0; i < arrays.length; i++) {
let item = arrays [i];
if (this.stepFilter.get("AllSamplerProxy").indexOf(item.type) !== -1 && item.value && item.value.success) {
arrays.splice(i, 1);
}
if (item.children && item.children.length > 0) {
this.getFails(item.children);
}
}
if (arrays[0] && this.stepFilter.get("AllSamplerProxy").indexOf(arrays[0].type) !== -1 && arrays[0].value && arrays[0].value.success) {
arrays.splice(0, 1);
}
},
recursiveSorting(arr) { recursiveSorting(arr) {
for (let i in arr) { for (let i in arr) {
if (arr[i]) { let step = arr[i];
arr[i].index = Number(i) + 1; if (step) {
if (arr[i].children && arr[i].children.length > 0) { step.index = Number(i) + 1;
this.recursiveSorting(arr[i].children); if (step.value) {
step.value.testing = false;
}
if (step.children && step.children.length > 0) {
this.recursiveSorting(step.children);
} }
} }
} }
@ -284,8 +279,8 @@ export default {
this.content.error = this.content.error; this.content.error = this.content.error;
this.content.success = (this.content.total - this.content.error); this.content.success = (this.content.total - this.content.error);
this.totalTime = this.content.totalTime; this.totalTime = this.content.totalTime;
this.failsTreeNodes = JSON.parse(JSON.stringify(this.fullTreeNodes)); this.fullTreeNodes = JSON.parse(JSON.stringify(this.fullTreeNodes));
this.getFails(this.failsTreeNodes); this.recursiveSorting(this.fullTreeNodes);
this.reload(); this.reload();
} }
}); });