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

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

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

View File

@ -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) {
//