refactor(接口测试): 修复场景导入JMX时后置脚本步骤顺序错乱的问题
--bug=1014065 --user=宋天阳 【接口自动化】github#14803jmeter脚本导入MeterSphere的接口自动化场景中,后置操作的顺序与jmeter中不一致会导致运行失败 https://www.tapd.cn/55049933/s/1182430
This commit is contained in:
parent
772cc6709d
commit
77c4ba4cf1
|
@ -756,7 +756,7 @@ export default {
|
||||||
if (item && map.has(item.resourceId)) {
|
if (item && map.has(item.resourceId)) {
|
||||||
item.domain = map.get(item.resourceId);
|
item.domain = map.get(item.resourceId);
|
||||||
item.resourceId = getUUID();
|
item.resourceId = getUUID();
|
||||||
}else{
|
} else {
|
||||||
item.domain = "";
|
item.domain = "";
|
||||||
}
|
}
|
||||||
if (item && item.hashTree && item.hashTree.length > 0) {
|
if (item && item.hashTree && item.hashTree.length > 0) {
|
||||||
|
@ -823,7 +823,7 @@ export default {
|
||||||
if (this.reportId) {
|
if (this.reportId) {
|
||||||
try {
|
try {
|
||||||
if (this.messageWebSocket) {
|
if (this.messageWebSocket) {
|
||||||
this.messageWebSocket.close();
|
this.messageWebSocket.close();
|
||||||
}
|
}
|
||||||
this.clearNodeStatus(this.$refs.stepTree.root.childNodes);
|
this.clearNodeStatus(this.$refs.stepTree.root.childNodes);
|
||||||
this.clearDebug();
|
this.clearDebug();
|
||||||
|
@ -836,7 +836,7 @@ export default {
|
||||||
let url = "/api/automation/stop/" + this.reportId;
|
let url = "/api/automation/stop/" + this.reportId;
|
||||||
this.$get(url, response => {
|
this.$get(url, response => {
|
||||||
this.debugLoading = false;
|
this.debugLoading = false;
|
||||||
},error =>{
|
}, error => {
|
||||||
this.debugLoading = false;
|
this.debugLoading = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -991,7 +991,7 @@ export default {
|
||||||
},
|
},
|
||||||
onDebugMessage(e) {
|
onDebugMessage(e) {
|
||||||
// 确认连接建立成功,开始执行
|
// 确认连接建立成功,开始执行
|
||||||
if(e && e.data === "CONN_SUCCEEDED"){
|
if (e && e.data === "CONN_SUCCEEDED") {
|
||||||
this.run();
|
this.run();
|
||||||
}
|
}
|
||||||
if (e.data && e.data.startsWith("result_")) {
|
if (e.data && e.data.startsWith("result_")) {
|
||||||
|
@ -1196,7 +1196,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.operatingElements = [];
|
this.operatingElements = [];
|
||||||
}
|
}
|
||||||
if ((!this.operatingElements && this.stepFilter)|| this.stepFilter.get("SpecialSteps").indexOf(data.type) !== -1) {
|
if ((!this.operatingElements && this.stepFilter) || this.stepFilter.get("SpecialSteps").indexOf(data.type) !== -1) {
|
||||||
this.operatingElements = this.stepFilter.get("ALL");
|
this.operatingElements = this.stepFilter.get("ALL");
|
||||||
}
|
}
|
||||||
this.selectedTreeNode = data;
|
this.selectedTreeNode = data;
|
||||||
|
@ -1266,14 +1266,14 @@ export default {
|
||||||
addCustomizeApi(request) {
|
addCustomizeApi(request) {
|
||||||
this.customizeVisible = false;
|
this.customizeVisible = false;
|
||||||
request.enable === undefined ? request.enable = true : request.enable;
|
request.enable === undefined ? request.enable = true : request.enable;
|
||||||
if(this.selectedTreeNode !== undefined){
|
if (this.selectedTreeNode !== undefined) {
|
||||||
if(this.stepFilter.get("SpecialSteps").indexOf(this.selectedTreeNode.type) !== -1){
|
if (this.stepFilter.get("SpecialSteps").indexOf(this.selectedTreeNode.type) !== -1) {
|
||||||
this.scenarioDefinition.splice(this.selectedTreeNode.index,0,request);
|
this.scenarioDefinition.splice(this.selectedTreeNode.index, 0, request);
|
||||||
this.$store.state.forceRerenderIndex = getUUID();
|
this.$store.state.forceRerenderIndex = getUUID();
|
||||||
}else{
|
} else {
|
||||||
this.selectedTreeNode.hashTree.push(request) ;
|
this.selectedTreeNode.hashTree.push(request);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
this.scenarioDefinition.push(request);
|
this.scenarioDefinition.push(request);
|
||||||
}
|
}
|
||||||
this.customizeRequest = {};
|
this.customizeRequest = {};
|
||||||
|
@ -1294,14 +1294,14 @@ export default {
|
||||||
this.resetResourceId(item.hashTree);
|
this.resetResourceId(item.hashTree);
|
||||||
item.enable === undefined ? item.enable = true : item.enable;
|
item.enable === undefined ? item.enable = true : item.enable;
|
||||||
item.variableEnable = item.variableEnable === undefined ? true : item.variableEnable;
|
item.variableEnable = item.variableEnable === undefined ? true : item.variableEnable;
|
||||||
if(this.selectedTreeNode !== undefined){
|
if (this.selectedTreeNode !== undefined) {
|
||||||
if(this.stepFilter.get("SpecialSteps").indexOf(this.selectedTreeNode.type) !== -1){
|
if (this.stepFilter.get("SpecialSteps").indexOf(this.selectedTreeNode.type) !== -1) {
|
||||||
this.scenarioDefinition.splice(this.selectedTreeNode.index,0,item);
|
this.scenarioDefinition.splice(this.selectedTreeNode.index, 0, item);
|
||||||
this.$store.state.forceRerenderIndex = getUUID();
|
this.$store.state.forceRerenderIndex = getUUID();
|
||||||
}else{
|
} else {
|
||||||
this.selectedTreeNode.hashTree.push(item) ;
|
this.selectedTreeNode.hashTree.push(item);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
this.scenarioDefinition.push(item);
|
this.scenarioDefinition.push(item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1346,14 +1346,14 @@ export default {
|
||||||
if (referenced === 'REF' && request.hashTree) {
|
if (referenced === 'REF' && request.hashTree) {
|
||||||
this.recursiveSorting(request.hashTree);
|
this.recursiveSorting(request.hashTree);
|
||||||
}
|
}
|
||||||
if(this.selectedTreeNode !== undefined){
|
if (this.selectedTreeNode !== undefined) {
|
||||||
if(this.stepFilter.get("SpecialSteps").indexOf(this.selectedTreeNode.type) !== -1){
|
if (this.stepFilter.get("SpecialSteps").indexOf(this.selectedTreeNode.type) !== -1) {
|
||||||
this.scenarioDefinition.splice(this.selectedTreeNode.index,0,request);
|
this.scenarioDefinition.splice(this.selectedTreeNode.index, 0, request);
|
||||||
this.$store.state.forceRerenderIndex = getUUID();
|
this.$store.state.forceRerenderIndex = getUUID();
|
||||||
}else{
|
} else {
|
||||||
this.selectedTreeNode.hashTree.push(request) ;
|
this.selectedTreeNode.hashTree.push(request);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
this.scenarioDefinition.push(request);
|
this.scenarioDefinition.push(request);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1508,7 +1508,7 @@ export default {
|
||||||
this.pluginDelStep = false;
|
this.pluginDelStep = false;
|
||||||
// 建立消息链接
|
// 建立消息链接
|
||||||
this.initMessageSocket();
|
this.initMessageSocket();
|
||||||
}else{
|
} else {
|
||||||
this.debugLoading = false;
|
this.debugLoading = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1763,9 +1763,6 @@ export default {
|
||||||
for (let i in stepArray) {
|
for (let i in stepArray) {
|
||||||
if (stepArray[i].type === "Assertions") {
|
if (stepArray[i].type === "Assertions") {
|
||||||
hisDataProcessing(stepArray, obj)
|
hisDataProcessing(stepArray, obj)
|
||||||
let assertions = stepArray[i];
|
|
||||||
stepArray.splice(i, 1);
|
|
||||||
stepArray.unshift(assertions);
|
|
||||||
this.sort();
|
this.sort();
|
||||||
}
|
}
|
||||||
let typeArray = ["JDBCPostProcessor", "JDBCSampler", "JDBCPreProcessor"]
|
let typeArray = ["JDBCPostProcessor", "JDBCSampler", "JDBCPreProcessor"]
|
||||||
|
@ -1898,15 +1895,15 @@ export default {
|
||||||
this.setDomain(true);
|
this.setDomain(true);
|
||||||
this.setStep(this.scenarioDefinition);
|
this.setStep(this.scenarioDefinition);
|
||||||
},
|
},
|
||||||
setStep(stepArray){
|
setStep(stepArray) {
|
||||||
for (let i in stepArray) {
|
for (let i in stepArray) {
|
||||||
let typeArray = ["JDBCPostProcessor", "JDBCSampler", "JDBCPreProcessor"]
|
let typeArray = ["JDBCPostProcessor", "JDBCSampler", "JDBCPreProcessor"]
|
||||||
if(typeArray.indexOf(stepArray[i].type) !== -1) {
|
if (typeArray.indexOf(stepArray[i].type) !== -1) {
|
||||||
if(stepArray[i].customizeReq ){
|
if (stepArray[i].customizeReq) {
|
||||||
if(stepArray[i].isRefEnvironment){
|
if (stepArray[i].isRefEnvironment) {
|
||||||
this.setStepEnv(stepArray[i]);
|
this.setStepEnv(stepArray[i]);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
this.setStepEnv(stepArray[i]);
|
this.setStepEnv(stepArray[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1934,7 +1931,7 @@ export default {
|
||||||
envId = request.refEevMap.get(projectId);
|
envId = request.refEevMap.get(projectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(envId === request.originalEnvironmentId && request.originalDataSourceId) {
|
if (envId === request.originalEnvironmentId && request.originalDataSourceId) {
|
||||||
request.dataSourceId = request.originalDataSourceId;
|
request.dataSourceId = request.originalDataSourceId;
|
||||||
}
|
}
|
||||||
let targetDataSourceName = "";
|
let targetDataSourceName = "";
|
||||||
|
@ -1954,9 +1951,9 @@ export default {
|
||||||
currentEnvironment = environment;
|
currentEnvironment = environment;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.initDataSource(envId, currentEnvironment, targetDataSourceName,request);
|
this.initDataSource(envId, currentEnvironment, targetDataSourceName, request);
|
||||||
},
|
},
|
||||||
initDataSource(envId, currentEnvironment, targetDataSourceName,request) {
|
initDataSource(envId, currentEnvironment, targetDataSourceName, request) {
|
||||||
this.databaseConfigsOptions = [];
|
this.databaseConfigsOptions = [];
|
||||||
if (envId) {
|
if (envId) {
|
||||||
request.environmentId = envId;
|
request.environmentId = envId;
|
||||||
|
|
Loading…
Reference in New Issue