fix (接口自动化): 修复引用步骤执行问题

This commit is contained in:
fit2-zhao 2021-07-30 19:06:39 +08:00 committed by fit2-zhao
parent 99ca5a6e08
commit 9636a37199
9 changed files with 45 additions and 45 deletions

View File

@ -72,7 +72,7 @@ public class MsJSR223Processor extends MsTestElement {
processor.setName(this.getName() + DelimiterConstants.SEPARATOR.toString() + name);
}
processor.setProperty("MS-ID", this.getId());
processor.setProperty("MS-RESOURCE-ID", this.getResourceId());
processor.setProperty("MS-RESOURCE-ID", this.getResourceId()+ "_" + this.getIndex());
List<String> id_names = new LinkedList<>();
this.getScenarioSet(this, id_names);
processor.setProperty("MS-SCENARIO", JSON.toJSONString(id_names));

View File

@ -244,7 +244,7 @@ public class MsJDBCPostProcessor extends MsTestElement {
jdbcPostProcessor.setProperty(TestElement.TEST_CLASS, JDBCPostProcessor.class.getName());
jdbcPostProcessor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI"));
jdbcPostProcessor.setProperty("MS-ID", this.getId());
jdbcPostProcessor.setProperty("MS-RESOURCE-ID", this.getResourceId());
jdbcPostProcessor.setProperty("MS-RESOURCE-ID", this.getResourceId()+ "_" + this.getIndex());
List<String> id_names = new LinkedList<>();
this.getScenarioSet(this, id_names);
jdbcPostProcessor.setProperty("MS-SCENARIO", JSON.toJSONString(id_names));

View File

@ -244,7 +244,7 @@ public class MsJDBCPreProcessor extends MsTestElement {
jdbcPreProcessor.setProperty(TestElement.TEST_CLASS, JDBCPreProcessor.class.getName());
jdbcPreProcessor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI"));
jdbcPreProcessor.setProperty("MS-ID", this.getId());
jdbcPreProcessor.setProperty("MS-RESOURCE-ID", this.getResourceId());
jdbcPreProcessor.setProperty("MS-RESOURCE-ID", this.getResourceId()+ "_" + this.getIndex());
List<String> id_names = new LinkedList<>();
this.getScenarioSet(this, id_names);
jdbcPreProcessor.setProperty("MS-SCENARIO", JSON.toJSONString(id_names));

View File

@ -141,7 +141,7 @@ public class MsDubboSampler extends MsTestElement {
sampler.setProperty(TestElement.TEST_CLASS, DubboSample.class.getName());
sampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("DubboSampleGui"));
sampler.setProperty("MS-ID", this.getId());
sampler.setProperty("MS-RESOURCE-ID", this.getResourceId());
sampler.setProperty("MS-RESOURCE-ID", this.getResourceId()+ "_" + this.getIndex());
List<String> id_names = new LinkedList<>();
this.getScenarioSet(this, id_names);
sampler.setProperty("MS-SCENARIO", JSON.toJSONString(id_names));

View File

@ -182,7 +182,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
sampler.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName());
sampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("HttpTestSampleGui"));
sampler.setProperty("MS-ID", this.getId());
sampler.setProperty("MS-RESOURCE-ID", this.getResourceId());
sampler.setProperty("MS-RESOURCE-ID", this.getResourceId()+ "_" + this.getIndex());
List<String> id_names = new LinkedList<>();
this.getScenarioSet(this, id_names);
sampler.setProperty("MS-SCENARIO", JSON.toJSONString(id_names));

View File

@ -240,7 +240,7 @@ public class MsJDBCSampler extends MsTestElement {
sampler.setProperty(TestElement.TEST_CLASS, JDBCSampler.class.getName());
sampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI"));
sampler.setProperty("MS-ID", this.getId());
sampler.setProperty("MS-RESOURCE-ID", this.getResourceId());
sampler.setProperty("MS-RESOURCE-ID", this.getResourceId()+ "_" + this.getIndex());
List<String> id_names = new LinkedList<>();
this.getScenarioSet(this, id_names);
sampler.setProperty("MS-SCENARIO", JSON.toJSONString(id_names));

View File

@ -204,7 +204,7 @@ public class MsTCPSampler extends MsTestElement {
tcpSampler.setName(this.getName() + DelimiterConstants.SEPARATOR.toString() + name);
}
tcpSampler.setProperty("MS-ID", this.getId());
tcpSampler.setProperty("MS-RESOURCE-ID", this.getResourceId());
tcpSampler.setProperty("MS-RESOURCE-ID", this.getResourceId() + "_" + this.getIndex());
List<String> id_names = new LinkedList<>();
this.getScenarioSet(this, id_names);
tcpSampler.setProperty("MS-SCENARIO", JSON.toJSONString(id_names));
@ -281,6 +281,7 @@ public class MsTCPSampler extends MsTestElement {
userParameters.setThreadLists(new CollectionProperty(UserParameters.THREAD_VALUES, collectionPropertyList));
tree.add(userParameters);
}
private String formatMockValue(String value) {
String patten = ">@[^>@]+</?";
@ -304,6 +305,7 @@ public class MsTCPSampler extends MsTestElement {
}
return value;
}
private ConfigTestElement tcpConfig() {
ConfigTestElement configTestElement = new ConfigTestElement();
configTestElement.setEnabled(true);

View File

@ -3,7 +3,9 @@
<ms-main-container>
<el-card>
<section class="report-container">
<div style="margin-top: 10px">
<ms-api-report-view-header :debug="debug" :export-flag="exportFlag" :report="report" @reportExport="handleExport" @reportSave="handleSave"/>
</div>
<main>
<ms-metric-chart :content="content" :totalTime="totalTime" v-if="!loading"/>
<div>
@ -156,7 +158,7 @@ export default {
hashTree.forEach(item => {
if (item.enable) {
let name = item.name ? item.name : item.type;
let obj = {resId: item.resourceId, index: Number(item.index), label: name, value: {name: name, responseResult: {}, unexecute: true}, children: [], unsolicited: true};
let obj = {resId: item.resourceId + "_" + item.index, index: Number(item.index), label: name, value: {name: name, responseResult: {}, unexecute: true}, children: [], unsolicited: true};
tree.children.push(obj);
if (ELEMENTS.get("AllSamplerProxy").indexOf(item.type) != -1) {
obj.unsolicited = false;
@ -503,10 +505,6 @@ export default {
font-size: 15px;
}
/deep/ .el-card__body {
padding: 10px;
}
.report-header a {
text-decoration: none;
}

View File

@ -533,7 +533,7 @@ export default {
},
resultEvaluationChild(arr, resourceId, status) {
arr.forEach(item => {
if (item.data.resourceId === resourceId) {
if (item.data.resourceId + "_" + item.data.index === resourceId) {
item.data.testing = false;
this.evaluationParent(item.parent, status);
}
@ -545,7 +545,7 @@ export default {
resultEvaluation(resourceId, status) {
if (this.$refs.stepTree && this.$refs.stepTree.root) {
this.$refs.stepTree.root.childNodes.forEach(item => {
if (item.data.resourceId === resourceId) {
if (item.data.resourceId + "_" + item.data.index === resourceId) {
item.data.testing = false;
}
if (item.childNodes && item.childNodes.length > 0) {
@ -622,7 +622,7 @@ export default {
},
runningNodeChild(arr, resourceId) {
arr.forEach(item => {
if (item.data && item.data.resourceId === resourceId) {
if (item.data && item.data.resourceId + "_" + item.data.index === resourceId) {
item.data.testing = true;
this.runningEditParent(item.parent);
}
@ -634,7 +634,7 @@ export default {
runningEvaluation(resourceId) {
if (this.$refs.stepTree && this.$refs.stepTree.root) {
this.$refs.stepTree.root.childNodes.forEach(item => {
if (item.data && item.data.resourceId === resourceId) {
if (item.data && item.data.resourceId + "_" + item.data.index === resourceId) {
item.data.testing = true;
}
if (item.childNodes && item.childNodes.length > 0) {
@ -866,7 +866,7 @@ export default {
}
}
// debug
let key = stepArray[i].resourceId;
let key = stepArray[i].resourceId + "_" + stepArray[i].index;
if (this.debugResult && this.debugResult.get(key)) {
stepArray[i].requestResult = this.debugResult.get(key);
stepArray[i].result = null;