fix(接口定义): 批量执行问题

This commit is contained in:
shiziyuan9527 2021-03-31 18:11:45 +08:00
parent a21c611d35
commit e3848b81f4
2 changed files with 16 additions and 10 deletions

View File

@ -58,22 +58,26 @@
}
},
run() {
let testPlan = new TestPlan();
let threadGroup = new ThreadGroup();
threadGroup.hashTree = [];
testPlan.hashTree = [threadGroup];
this.runData.forEach(item => {
threadGroup.hashTree.push(item);
})
let projectId = "";
let projectId = this.$store.state.projectId;
// envMap
if (!this.envMap || this.envMap.size === 0) {
projectId = this.$store.state.projectId;
} else {
//
projectId = this.runData.projectId;
if(this.runData.projectId){
projectId = this.runData.projectId;
}
}
let testPlan = new TestPlan();
let threadGroup = new ThreadGroup();
threadGroup.hashTree = [];
testPlan.hashTree = [threadGroup];
this.runData.forEach(item => {
item.projectId = projectId;
threadGroup.hashTree.push(item);
})
let reqObj = {id: this.reportId, testElement: testPlan, type: this.type,projectId: projectId, environmentMap: strMapToObj(this.envMap)};
let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
let url = "";

View File

@ -305,6 +305,8 @@
this.$warning(this.$t('api_test.environment.select_environment'));
return;
}
this.envMap = new Map();
this.envMap.set(this.$store.state.projectId,this.environment);
this.runData = [];
this.batchLoadingIds = [];
this.selectdCases = [];