fix(UI自动化): 修复执行生成报告,报告顺序问题

--bug=1014053 --user=刘瑶 【UI测试】UI报告,循环里套循环的时候,报告显示顺序不是循环的顺序 https://www.tapd.cn/55049933/s/1186470
This commit is contained in:
nathan.liu 2022-06-20 11:37:38 +08:00 committed by f2c-ci-robot[bot]
parent 528a9edc4d
commit 8aafb5ccbd
3 changed files with 71 additions and 3 deletions

@ -1 +1 @@
Subproject commit 4ac3f8294a9b432398dce7c3e84be2fcacb07d7c
Subproject commit 952b8ba44820b5ae7b604b6505d66fe89401ec44

View File

@ -127,6 +127,7 @@ export default {
messageWebSocket: {},
websocket: {},
stepFilter: new STEP,
tempResult: [],
}
},
activated() {
@ -315,7 +316,18 @@ export default {
this.content.success = (this.content.total - this.content.error - this.content.errorCode - this.content.unExecute);
this.totalTime = this.content.totalTime;
this.resetLabel(this.content.steps);
this.fullTreeNodes = this.content.steps
if(this.report.reportType === "UI_INDEPENDENT"){
this.tempResult = this.content.steps;
//
try{
this.checkOrder(this.tempResult);
this.fullTreeNodes = this.tempResult;
}catch(e){
this.fullTreeNodes = this.content.steps;
}
}else{
this.fullTreeNodes = this.content.steps;
}
this.recursiveSorting(this.fullTreeNodes);
this.reload();
}
@ -324,6 +336,62 @@ export default {
}
});
},
checkOrder(origin){
if(!origin){
return;
}
if(Array.isArray(origin)){
this.sortChildren(origin);
origin.forEach(v => {
if(v.children){
this.checkOrder(v.children)
}
})
}
},
sortChildren(source){
if(!source){
return;
}
source.forEach( item =>{
let children = item.children;
if(children && children.length > 0){
let tempArr = new Array(children.length);
let tempMap = new Map();
for(let i = 0; i < children.length; i++){
if(!children[i].value || !children[i].value.startTime || children[i].value.startTime === 0){
//valuestep
tempArr[i] = children[i];
//
tempMap.set(children[i].stepId, children[i])
}
}
//step
let arr = children.filter(m => {
return !tempMap.get(m.stepId);
}).sort((m, n) => {
//
return m.value.startTime - n.value.startTime;
});
//arr() tempArr
for(let j = 0, i = 0; j < tempArr.length; j++){
if(!tempArr[j]){
//
tempArr[j] = arr[i];
i++;
}
//
tempArr[j].index = j + 1;
}
//
item.children = tempArr;
}
})
},
runningNodeChild(arr, resourceId) {
arr.forEach(item => {
if (resourceId === item.resId) {

@ -1 +1 @@
Subproject commit b6a9ea1cac4be67f8fc64cc75b9994827f381e09
Subproject commit 218a3cadaf6715d318e8cd4a4b3f6502070a5453