From 3c90c620d0da2d874d12e85bd9f6bf034ddecb95 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 21 Feb 2022 17:02:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BBmock=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=97=B6=E5=85=B3=E4=BA=8E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010331 --user=宋天阳 【接口测试】mock执行按钮自动填充数据问题汇总 https://www.tapd.cn/55049933/s/1106660 --- .../ext/ExtTestPlanScenarioCaseMapper.xml | 4 +-- .../components/runtest/RunTestHTTPPage.vue | 26 ++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml index d880c58ad8..db964fec41 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml @@ -239,7 +239,7 @@ 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 diff --git a/frontend/src/business/components/api/definition/components/runtest/RunTestHTTPPage.vue b/frontend/src/business/components/api/definition/components/runtest/RunTestHTTPPage.vue index 51ed91ede0..febd783823 100644 --- a/frontend/src/business/components/api/definition/components/runtest/RunTestHTTPPage.vue +++ b/frontend/src/business/components/api/definition/components/runtest/RunTestHTTPPage.vue @@ -56,6 +56,7 @@

{{ $t('api_test.definition.request.req_param') }}

@@ -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) {