Merge remote-tracking branch 'origin/v1.8' into v1.8

This commit is contained in:
song-tianyang 2021-03-31 18:27:50 +08:00
commit 22463ee6bb
4 changed files with 31 additions and 15 deletions

View File

@ -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());

View File

@ -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 {
// //
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 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 = "";

View File

@ -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 = [];

View File

@ -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 => {
if (api.moduleId === item.id) { buildNodePath(item, {path: ''}, options);
api.modulePath = item.path;
}
}); });
}); apis.forEach((api) => {
options.forEach((item) => {
if (api.moduleId === item.id) {
api.modulePath = item.path;
}
})
});
} catch (e) {
console.log(e);
}
}, },
sort(column) { sort(column) {
// //