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.setPrincipal(request.getPrincipal());
|
||||||
scenario.setStepTotal(request.getStepTotal());
|
scenario.setStepTotal(request.getStepTotal());
|
||||||
scenario.setUpdateTime(System.currentTimeMillis());
|
scenario.setUpdateTime(System.currentTimeMillis());
|
||||||
|
scenario.setDescription(request.getDescription());
|
||||||
scenario.setScenarioDefinition(JSON.toJSONString(request.getScenarioDefinition()));
|
scenario.setScenarioDefinition(JSON.toJSONString(request.getScenarioDefinition()));
|
||||||
if (StringUtils.isNotEmpty(request.getStatus())) {
|
if (StringUtils.isNotEmpty(request.getStatus())) {
|
||||||
scenario.setStatus(request.getStatus());
|
scenario.setStatus(request.getStatus());
|
||||||
|
|
|
@ -58,22 +58,26 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
run() {
|
run() {
|
||||||
let testPlan = new TestPlan();
|
let projectId = this.$store.state.projectId;
|
||||||
let threadGroup = new ThreadGroup();
|
|
||||||
threadGroup.hashTree = [];
|
|
||||||
testPlan.hashTree = [threadGroup];
|
|
||||||
this.runData.forEach(item => {
|
|
||||||
threadGroup.hashTree.push(item);
|
|
||||||
})
|
|
||||||
|
|
||||||
let projectId = "";
|
|
||||||
// 如果envMap不存在,是单接口调用
|
// 如果envMap不存在,是单接口调用
|
||||||
if (!this.envMap || this.envMap.size === 0) {
|
if (!this.envMap || this.envMap.size === 0) {
|
||||||
projectId = this.$store.state.projectId;
|
projectId = this.$store.state.projectId;
|
||||||
} else {
|
} else {
|
||||||
// 场景步骤下接口调用
|
// 场景步骤下接口调用
|
||||||
|
if(this.runData.projectId){
|
||||||
projectId = 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 reqObj = {id: this.reportId, testElement: testPlan, type: this.type,projectId: projectId, environmentMap: strMapToObj(this.envMap)};
|
||||||
let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
|
let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
|
||||||
let url = "";
|
let url = "";
|
||||||
|
|
|
@ -306,6 +306,8 @@
|
||||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
this.$warning(this.$t('api_test.environment.select_environment'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.envMap = new Map();
|
||||||
|
this.envMap.set(this.$store.state.projectId,this.environment);
|
||||||
this.runData = [];
|
this.runData = [];
|
||||||
this.batchLoadingIds = [];
|
this.batchLoadingIds = [];
|
||||||
this.selectdCases = [];
|
this.selectdCases = [];
|
||||||
|
|
|
@ -248,6 +248,7 @@ import {Api_List} from "@/business/components/common/model/JsonData";
|
||||||
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
||||||
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
|
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
|
||||||
import {Body} from "@/business/components/api/definition/model/ApiTestModel";
|
import {Body} from "@/business/components/api/definition/model/ApiTestModel";
|
||||||
|
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -768,13 +769,21 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
buildApiPath(apis) {
|
buildApiPath(apis) {
|
||||||
apis.forEach((api) => {
|
try {
|
||||||
|
let options = [];
|
||||||
this.moduleOptions.forEach(item => {
|
this.moduleOptions.forEach(item => {
|
||||||
|
buildNodePath(item, {path: ''}, options);
|
||||||
|
});
|
||||||
|
apis.forEach((api) => {
|
||||||
|
options.forEach((item) => {
|
||||||
if (api.moduleId === item.id) {
|
if (api.moduleId === item.id) {
|
||||||
api.modulePath = item.path;
|
api.modulePath = item.path;
|
||||||
}
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
});
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
sort(column) {
|
sort(column) {
|
||||||
// 每次只对一个字段排序
|
// 每次只对一个字段排序
|
||||||
|
|
Loading…
Reference in New Issue