fix(测试跟踪): 修复测试计划报告导出后场景报告步骤归类的问题

--bug=1026246 --user=宋天阳 【测试跟踪】报告-导出-误报结果显示到了失败tab页
https://www.tapd.cn/55049933/s/1372605
This commit is contained in:
song-tianyang 2023-05-18 11:17:32 +08:00 committed by 建国
parent d7a9828846
commit 5e6ce548ca
3 changed files with 78 additions and 17 deletions

View File

@ -45,7 +45,8 @@
:report="report"
:is-share="isShare"
:share-id="shareId"
:treeData="fullTreeNodes" ref="failsTree"
:is-template="isTemplate"
:treeData="errorTreeNodes" ref="failsTree"
:errorReport="content.error"/>
</el-tab-pane>
<!--error step -->
@ -60,8 +61,9 @@
:report="report"
:is-share="isShare"
:share-id="shareId"
:is-template="isTemplate"
:console="content.console"
:treeData="fullTreeNodes" ref="errorReportTree"/>
:treeData="fakeErrorTreeNodes" ref="errorReportTree"/>
</el-tab-pane>
<!-- Not performed step -->
<el-tab-pane name="unExecute" v-if="content.unExecute > 0">
@ -75,9 +77,10 @@
v-on:requestResult="requestResult"
:report="report"
:is-share="isShare"
:is-template="isTemplate"
:share-id="shareId"
:console="content.console"
:treeData="fullTreeNodes" ref="unExecuteTree"/>
:treeData="unExecuteTreeNodes" ref="unExecuteTree"/>
</el-tab-pane>
<!-- console -->
<el-tab-pane name="console">
@ -155,6 +158,9 @@ export default {
projectEnvMap: {},
showCancel: false,
poolName: '',
errorTreeNodes: [],
unExecuteTreeNodes: [],
fakeErrorTreeNodes: [],
}
},
activated() {
@ -189,14 +195,70 @@ export default {
},
methods: {
filter(index) {
if (index === "1") {
this.$refs.failsTree.filter(index);
} else if (this.activeName === "errorReport") {
this.$refs.errorReportTree.filter("FAKE_ERROR");
} else if (this.activeName === "unExecute") {
this.$refs.unExecuteTree.filter("PENDING");
if (index === '1') {
//
this.initFilterTreeNodes('ERROR');
} else if (this.activeName === 'errorReport') {
this.initFilterTreeNodes('FAKE_ERROR');
} else if (this.activeName === 'unExecute') {
this.initFilterTreeNodes('UN_EXECUTE');
}
},
initFilterTreeNodes(status) {
if (this.fullTreeNodes.length > 0) {
let filteredTreeNodeArr = [];
for (let i = 0; i < this.fullTreeNodes.length; i++) {
let node = this.filterNodes(this.fullTreeNodes[i], status);
if (node) {
filteredTreeNodeArr.push(node);
}
}
if (status === 'ERROR') {
this.errorTreeNodes = filteredTreeNodeArr;
} else if (status === 'FAKE_ERROR') {
this.fakeErrorTreeNodes = filteredTreeNodeArr;
} else if (status === 'UN_EXECUTE') {
this.unExecuteTreeNodes = filteredTreeNodeArr;
}
}
},
filterNodes(node, status) {
if (status === 'ERROR' || status === 'FAKE_ERROR' || status === 'UN_EXECUTE') {
let data = {...node};
if (!data.value && (!data.children || data.children.length === 0)) {
return null;
}
if (data.children.length > 0) {
let filteredChildren = [];
for (let i = 0; i < data.children.length; i++) {
let filteredNode = this.filterNodes(data.children[i], status);
if (filteredNode) {
filteredChildren.push(filteredNode);
}
}
data.children = filteredChildren;
}
if (data.children.length > 0) {
return data;
} else {
if (status === 'FAKE_ERROR') {
if (data.errorCode && data.errorCode !== '' && data.value.status === 'FAKE_ERROR') {
return data;
}
} else if (status === 'UN_EXECUTE') {
if (data.value && data.value.status === 'PENDING') {
return data;
}
} else if (status === 'ERROR') {
if (data.totalStatus !== 'FAKE_ERROR' && data.value && data.value.error > 0) {
return data;
}
}
}
}
return null;
},
init() {
this.loading = true;
this.projectEnvMap = {};

View File

@ -191,7 +191,7 @@
</div>
</el-col>
<el-col :span="2">
<div v-if="totalStatus">
<div v-if="totalStatus" style="float:right;">
<el-tag size="mini"
v-if="totalStatus === 'unexecute' || totalStatus === 'Pending'|| totalStatus === 'PENDING'"
> Pending
@ -221,17 +221,17 @@
Error </el-tag
>
</div>
<div v-else>
<div v-else style="float:right;">
<el-tag
v-if="request.testing"
class="ms-test-running"
size="mini"
>
<i class="el-icon-loading" style="font-size: 16px" />
<i class="el-icon-loading" style="font-size: 16px"/>
Pending
</el-tag>
<el-tag size="mini" v-else-if="request.unexecute"
>Pending
<el-tag size="mini" v-else-if="request.unexecute">
Pending
</el-tag>
<el-tag
size="mini"
@ -239,8 +239,8 @@
!request.success &&
request.status &&
request.status === 'unexecute'
"
>Pending
">
Pending
</el-tag>
<el-tag
v-else-if="

View File

@ -120,7 +120,6 @@ export default {
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root, 0);
},
openExpansion() {
this.isActive = true;
this.expandAll = true;
//
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root, 0)