fix(测试跟踪): 修复测试计划用例大批量执行超时问题

This commit is contained in:
fit2-zhao 2023-02-01 13:26:12 +08:00 committed by 建国
parent f73576785f
commit 5e9d29d711
1 changed files with 13 additions and 30 deletions

View File

@ -388,7 +388,6 @@ export default {
selectDataCounts: 0,
screenHeight: "calc(100vh - 250px)", //
currentCaseProjectId: "",
runData: [],
testPlanCaseIds: [],
reportId: "",
rowLoading: "",
@ -610,7 +609,6 @@ export default {
getData() {
return new Promise((resolve) => {
let index = 1;
this.runData = [];
this.testPlanCaseIds = [];
if (this.condition != null && this.condition.selectAll) {
let selectAllRowParams = buildBatchParam(this);
@ -621,40 +619,25 @@ export default {
//
this.orderBySelectRows(dataRows);
dataRows.forEach((row) => {
apiTestCaseGet(row.caseId).then((response) => {
let apiCase = response.data;
let request = JSON.parse(apiCase.request);
request.name = row.id;
request.id = row.id;
request.useEnvironment = row.environmentId;
this.runData.unshift(request);
this.testPlanCaseIds.unshift(row.id);
this.testPlanCaseIds.push(row.id);
if (dataRows.length === index) {
resolve();
}
index++;
});
});
}
);
} else {
//
let dataRows = this.orderBySelectRows(this.$refs.table.selectRows);
//
this.orderBySelectRows(dataRows);
dataRows.forEach((row) => {
apiTestCaseGet(row.caseId).then((response) => {
let apiCase = response.data;
let request = JSON.parse(apiCase.request);
request.name = row.id;
request.id = row.id;
request.useEnvironment = row.environmentId;
this.runData.unshift(request);
this.testPlanCaseIds.unshift(row.id);
this.testPlanCaseIds.push(row.id);
if (dataRows.length === index) {
resolve();
}
index++;
});
});
}
});
},
@ -697,7 +680,7 @@ export default {
},
handleBatchExecute() {
this.getData().then(() => {
if (this.runData && this.runData.length > 0) {
if (this.testPlanCaseIds && this.testPlanCaseIds.length > 0) {
this.$refs.runMode.open("API");
}
});