fix(接口自动化) 历史数据处理

--bug=1006814 --user=赵勇 【接口自动化】之前添加的旧场景,调试都会报错,重新保存,再执行才会正常 https://www.tapd.cn/55049933/s/1049192
This commit is contained in:
fit2-zhao 2021-09-22 14:14:59 +08:00 committed by fit2-zhao
parent f592708085
commit 4dd9594329
2 changed files with 14 additions and 1 deletions

View File

@ -264,7 +264,7 @@ public class ElementUtil {
put("ThreadGroup", "io.metersphere.api.dto.definition.request.MsThreadGroup");
put("DNSCacheManager", "io.metersphere.api.dto.definition.request.dns.MsDNSCacheManager");
put("DebugSampler", "io.metersphere.api.dto.definition.request.sampler.MsDebugSampler");
put("AuthManager", "io.metersphere.api.dto.definition.request.auth.MsAuthManager");
}
};

View File

@ -33,6 +33,18 @@ export default {
}
},
methods: {
sort(stepArray) {
if (stepArray) {
for (let i in stepArray) {
if (!stepArray[i].clazzName) {
stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type);
}
if (stepArray[i].hashTree && stepArray[i].hashTree.length > 0) {
this.sort(stepArray[i].hashTree);
}
}
}
},
run() {
let testPlan = createComponent('TestPlan');
testPlan.clazzName = TYPE_TO_C.get(testPlan.type);
@ -47,6 +59,7 @@ export default {
this.runData.clazzName = TYPE_TO_C.get(this.runData.type);
threadGroup.hashTree.push(this.runData);
testPlan.hashTree.push(threadGroup);
this.sort(testPlan.hashTree);
let reqObj = {
id: this.reportId, reportId: this.reportId, scenarioName: this.runData.name, saved: this.saved,
scenarioId: this.runData.id, testElement: testPlan, projectId: getCurrentProjectID(), environmentMap: strMapToObj(map)