fix(接口测试): 修复点击mock执行按钮时关于自动填充数据的问题

--bug=1010331 --user=宋天阳 【接口测试】mock执行按钮自动填充数据问题汇总
https://www.tapd.cn/55049933/s/1106660
This commit is contained in:
song-tianyang 2022-02-21 17:02:17 +08:00 committed by CountryBuilder
parent 3936c62ede
commit 3c90c620d0
2 changed files with 27 additions and 3 deletions

View File

@ -239,7 +239,7 @@
</select>
<select id="getFailureList" resultType="io.metersphere.api.dto.automation.TestPlanFailureScenarioDTO">
select
t.id, t.last_result, t.report_id, c.user_id, c.module_path, c.name, c.level,
t.id, t.last_result, t.report_id, c.user_id, c.module_path, c.name, c.level,c.create_user,c.principal,
c.status,c.step_total, c.step_total, c.project_id,
c.num, c.custom_num
from
@ -259,7 +259,7 @@
<select id="getFailureListByIds" resultType="io.metersphere.api.dto.automation.TestPlanFailureScenarioDTO">
select
t.id, t.last_result, t.report_id, c.user_id, c.module_path, c.name, c.level,
t.id, t.last_result, t.report_id, c.user_id, c.module_path, c.name, c.level,c.create_user,c.principal,
c.status,c.step_total, c.step_total, c.project_id,
c.num, c.custom_num
from

View File

@ -56,6 +56,7 @@
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
<!-- HTTP 请求参数 -->
<ms-api-request-form :isShowEnable="true" :definition-test="true" :headers="api.request.headers"
v-if="loadRequest"
:request="api.request"/>
<!--返回结果-->
<!-- HTTP 请求返回数据 -->
@ -111,6 +112,7 @@ export default {
api: {},
loaded: false,
loading: false,
loadRequest: true,
createCase: "",
currentRequest: {},
refreshSign: "",
@ -146,13 +148,31 @@ export default {
if (param.headers) {
this.api.request.headers = param.headers;
}
if (param.arguments!==null && param.arguments.length > 0) {
if (param.arguments !== null && param.arguments.length > 0) {
for (let i = 0; i < param.arguments.length; i++) {
if (!param.arguments[i].required) {
param.arguments[i].required = true;
}
}
this.api.request.arguments = param.arguments;
}
if (param.body) {
if (param.body.kvs) {
for (let i = 0; i < param.body.kvs.length; i++) {
if (!param.body.kvs[i].required) {
param.body.kvs[i].required = true;
}
}
}
this.api.request.body = param.body;
}
if (param.rest) {
for (let i = 0; i < param.rest.length; i++) {
if (!param.rest[i].required) {
param.rest[i].required = true;
}
}
this.api.request.rest = param.rest;
}
}
@ -167,6 +187,10 @@ export default {
});
})
}
this.loadRequest = false;
this.$nextTick(() => {
this.loadRequest = true;
})
},
handleCommand(e) {
switch (e) {