fix(测试跟踪): 修复测试计划报告导出后场景报告步骤归类的问题
--bug=1026246 --user=宋天阳 【测试跟踪】报告-导出-误报结果显示到了失败tab页 https://www.tapd.cn/55049933/s/1372605
This commit is contained in:
parent
d7a9828846
commit
5e6ce548ca
|
@ -45,7 +45,8 @@
|
||||||
:report="report"
|
:report="report"
|
||||||
:is-share="isShare"
|
:is-share="isShare"
|
||||||
:share-id="shareId"
|
:share-id="shareId"
|
||||||
:treeData="fullTreeNodes" ref="failsTree"
|
:is-template="isTemplate"
|
||||||
|
:treeData="errorTreeNodes" ref="failsTree"
|
||||||
:errorReport="content.error"/>
|
:errorReport="content.error"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!--error step -->
|
<!--error step -->
|
||||||
|
@ -60,8 +61,9 @@
|
||||||
:report="report"
|
:report="report"
|
||||||
:is-share="isShare"
|
:is-share="isShare"
|
||||||
:share-id="shareId"
|
:share-id="shareId"
|
||||||
|
:is-template="isTemplate"
|
||||||
:console="content.console"
|
:console="content.console"
|
||||||
:treeData="fullTreeNodes" ref="errorReportTree"/>
|
:treeData="fakeErrorTreeNodes" ref="errorReportTree"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- Not performed step -->
|
<!-- Not performed step -->
|
||||||
<el-tab-pane name="unExecute" v-if="content.unExecute > 0">
|
<el-tab-pane name="unExecute" v-if="content.unExecute > 0">
|
||||||
|
@ -75,9 +77,10 @@
|
||||||
v-on:requestResult="requestResult"
|
v-on:requestResult="requestResult"
|
||||||
:report="report"
|
:report="report"
|
||||||
:is-share="isShare"
|
:is-share="isShare"
|
||||||
|
:is-template="isTemplate"
|
||||||
:share-id="shareId"
|
:share-id="shareId"
|
||||||
:console="content.console"
|
:console="content.console"
|
||||||
:treeData="fullTreeNodes" ref="unExecuteTree"/>
|
:treeData="unExecuteTreeNodes" ref="unExecuteTree"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- console -->
|
<!-- console -->
|
||||||
<el-tab-pane name="console">
|
<el-tab-pane name="console">
|
||||||
|
@ -155,6 +158,9 @@ export default {
|
||||||
projectEnvMap: {},
|
projectEnvMap: {},
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
poolName: '',
|
poolName: '',
|
||||||
|
errorTreeNodes: [],
|
||||||
|
unExecuteTreeNodes: [],
|
||||||
|
fakeErrorTreeNodes: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
|
@ -189,14 +195,70 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
filter(index) {
|
filter(index) {
|
||||||
if (index === "1") {
|
if (index === '1') {
|
||||||
this.$refs.failsTree.filter(index);
|
//查询失败的步骤
|
||||||
} else if (this.activeName === "errorReport") {
|
this.initFilterTreeNodes('ERROR');
|
||||||
this.$refs.errorReportTree.filter("FAKE_ERROR");
|
} else if (this.activeName === 'errorReport') {
|
||||||
} else if (this.activeName === "unExecute") {
|
this.initFilterTreeNodes('FAKE_ERROR');
|
||||||
this.$refs.unExecuteTree.filter("PENDING");
|
} 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() {
|
init() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.projectEnvMap = {};
|
this.projectEnvMap = {};
|
||||||
|
|
|
@ -191,7 +191,7 @@
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<div v-if="totalStatus">
|
<div v-if="totalStatus" style="float:right;">
|
||||||
<el-tag size="mini"
|
<el-tag size="mini"
|
||||||
v-if="totalStatus === 'unexecute' || totalStatus === 'Pending'|| totalStatus === 'PENDING'"
|
v-if="totalStatus === 'unexecute' || totalStatus === 'Pending'|| totalStatus === 'PENDING'"
|
||||||
> Pending
|
> Pending
|
||||||
|
@ -221,17 +221,17 @@
|
||||||
Error </el-tag
|
Error </el-tag
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else style="float:right;">
|
||||||
<el-tag
|
<el-tag
|
||||||
v-if="request.testing"
|
v-if="request.testing"
|
||||||
class="ms-test-running"
|
class="ms-test-running"
|
||||||
size="mini"
|
size="mini"
|
||||||
>
|
>
|
||||||
<i class="el-icon-loading" style="font-size: 16px" />
|
<i class="el-icon-loading" style="font-size: 16px"/>
|
||||||
Pending
|
Pending
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag size="mini" v-else-if="request.unexecute"
|
<el-tag size="mini" v-else-if="request.unexecute">
|
||||||
>Pending
|
Pending
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag
|
<el-tag
|
||||||
size="mini"
|
size="mini"
|
||||||
|
@ -239,8 +239,8 @@
|
||||||
!request.success &&
|
!request.success &&
|
||||||
request.status &&
|
request.status &&
|
||||||
request.status === 'unexecute'
|
request.status === 'unexecute'
|
||||||
"
|
">
|
||||||
>Pending
|
Pending
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag
|
<el-tag
|
||||||
v-else-if="
|
v-else-if="
|
||||||
|
|
|
@ -120,7 +120,6 @@ export default {
|
||||||
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root, 0);
|
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root, 0);
|
||||||
},
|
},
|
||||||
openExpansion() {
|
openExpansion() {
|
||||||
this.isActive = true;
|
|
||||||
this.expandAll = true;
|
this.expandAll = true;
|
||||||
// 改变每个节点的状态
|
// 改变每个节点的状态
|
||||||
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root, 0)
|
this.changeTreeNodeStatus(this.$refs.resultsTree.store.root, 0)
|
||||||
|
|
Loading…
Reference in New Issue