Merge remote-tracking branch 'origin/v1.8' into v1.8
This commit is contained in:
commit
22463ee6bb
|
@ -232,6 +232,7 @@ public class ApiAutomationService {
|
|||
scenario.setPrincipal(request.getPrincipal());
|
||||
scenario.setStepTotal(request.getStepTotal());
|
||||
scenario.setUpdateTime(System.currentTimeMillis());
|
||||
scenario.setDescription(request.getDescription());
|
||||
scenario.setScenarioDefinition(JSON.toJSONString(request.getScenarioDefinition()));
|
||||
if (StringUtils.isNotEmpty(request.getStatus())) {
|
||||
scenario.setStatus(request.getStatus());
|
||||
|
|
|
@ -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 = "";
|
||||
|
|
|
@ -306,6 +306,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 = [];
|
||||
|
|
|
@ -248,6 +248,7 @@ import {Api_List} from "@/business/components/common/model/JsonData";
|
|||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
|
||||
import {Body} from "@/business/components/api/definition/model/ApiTestModel";
|
||||
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
|
||||
|
||||
|
||||
export default {
|
||||
|
@ -768,13 +769,21 @@ export default {
|
|||
});
|
||||
},
|
||||
buildApiPath(apis) {
|
||||
apis.forEach((api) => {
|
||||
try {
|
||||
let options = [];
|
||||
this.moduleOptions.forEach(item => {
|
||||
if (api.moduleId === item.id) {
|
||||
api.modulePath = item.path;
|
||||
}
|
||||
buildNodePath(item, {path: ''}, options);
|
||||
});
|
||||
});
|
||||
apis.forEach((api) => {
|
||||
options.forEach((item) => {
|
||||
if (api.moduleId === item.id) {
|
||||
api.modulePath = item.path;
|
||||
}
|
||||
})
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
sort(column) {
|
||||
// 每次只对一个字段排序
|
||||
|
|
Loading…
Reference in New Issue