fix(接口自动化): 修复部分缺陷

This commit is contained in:
fit2-zhao 2021-01-25 18:44:18 +08:00
parent 7737ee160a
commit b0ee42f9e4
7 changed files with 28 additions and 13 deletions

View File

@ -50,6 +50,8 @@ public class MsJDBCSampler extends MsTestElement {
private Object requestResult;
@JSONField(ordinal = 28)
private String dataSourceId;
@JSONField(ordinal = 29)
private String protocol="SQL";
@Override
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {

View File

@ -65,6 +65,8 @@ public class MsTCPSampler extends MsTestElement {
private String useEnvironment;
@JSONField(ordinal = 37)
private MsJSR223PreProcessor tcpPreProcessor;
@JSONField(ordinal = 38)
private String protocol = "TCP";
@Override
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, ParameterConfig config) {
@ -132,10 +134,12 @@ public class MsTCPSampler extends MsTestElement {
userParameters.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("UserParametersGui"));
List<StringProperty> names = new ArrayList<>();
List<StringProperty> threadValues = new ArrayList<>();
this.parameters.forEach(item -> {
names.add(new StringProperty(new Integer(new Random().nextInt(1000000)).toString(), item.getName()));
threadValues.add(new StringProperty(new Integer(new Random().nextInt(1000000)).toString(), item.getValue()));
});
if (CollectionUtils.isNotEmpty(this.parameters)) {
this.parameters.forEach(item -> {
names.add(new StringProperty(new Integer(new Random().nextInt(1000000)).toString(), item.getName()));
threadValues.add(new StringProperty(new Integer(new Random().nextInt(1000000)).toString(), item.getValue()));
});
}
userParameters.setNames(new CollectionProperty(UserParameters.NAMES, names));
List<CollectionProperty> collectionPropertyList = new ArrayList<>();
collectionPropertyList.add(new CollectionProperty(new Integer(new Random().nextInt(1000000)).toString(), threadValues));

View File

@ -873,6 +873,7 @@
}
this.enableCookieShare = obj.enableCookieShare;
this.scenarioDefinition = obj.hashTree;
console.log(this.scenarioDefinition)
}
}
if (this.currentScenario.copy) {

View File

@ -25,10 +25,16 @@
<div class="header-right" @click.stop>
<slot name="message"></slot>
<el-switch v-model="data.enable" class="enable-switch"/>
<el-tooltip :content="$t('test_resource_pool.enable_disable')" placement="top">
<el-switch v-model="data.enable" class="enable-switch"/>
</el-tooltip>
<slot name="button"></slot>
<el-button size="mini" icon="el-icon-copy-document" circle @click="copyRow"/>
<el-button size="mini" icon="el-icon-delete" type="danger" circle @click="remove"/>
<el-tooltip content="Copy" placement="top">
<el-button size="mini" icon="el-icon-copy-document" circle @click="copyRow"/>
</el-tooltip>
<el-tooltip :content="$t('commons.remove')" placement="top">
<el-button size="mini" icon="el-icon-delete" type="danger" circle @click="remove"/>
</el-tooltip>
</div>
</div>

View File

@ -20,7 +20,9 @@
</template>
<template v-slot:button>
<el-button @click="run" :tip="$t('api_test.run')" icon="el-icon-video-play" style="background-color: #409EFF;color: white;" size="mini" circle/>
<el-tooltip :content="$t('api_test.run')" placement="top">
<el-button @click="run" icon="el-icon-video-play" style="background-color: #409EFF;color: white;" size="mini" circle/>
</el-tooltip>
</template>
<div v-if="request.protocol === 'HTTP'">
@ -42,7 +44,7 @@
<ms-dubbo-basis-parameters :request="request" v-if="request.protocol==='DUBBO' || request.protocol==='dubbo://'|| request.type==='DubboSampler'" :showScript="false"/>
<p class="tip">{{$t('api_test.definition.request.res_param')}} </p>
<api-response-component :result="request.requestResult"/>
<api-response-component :currentProtocol="request.protocol" :result="request.requestResult"/>
<!-- 保存操作 -->
<el-button type="primary" size="small" style="margin: 20px; float: right" @click="saveTestCase(item)" v-if="!request.referenced">
@ -86,7 +88,7 @@
reqOptions: REQ_METHOD,
reportId: "",
runData: [],
isShowInput: false
isShowInput: false,
}
},
created() {

View File

@ -8,7 +8,7 @@
<el-collapse-transition>
<div v-if="isActive">
<el-divider></el-divider>
<ms-request-result-tail :show-metric="false" :response="response"/>
<ms-request-result-tail :currentProtocol="currentProtocol" :show-metric="false" :response="response"/>
</div>
</el-collapse-transition>
</el-card>
@ -24,7 +24,7 @@
export default {
name: "ApiResponseComponent",
components: {ElCollapseTransition, MsRequestResultTail, ApiBaseComponent, MsRequestMetric},
props: {apiItem: {}, result: {}},
props: {apiItem: {}, result: {}, currentProtocol: String},
data() {
return {
isActive: false,

View File

@ -31,7 +31,7 @@
},
data() {
return {
title: this.$t('api_test.automation.customize_script'),
title: "",
titleColor: "",
backgroundColor: "",
}