From 6bd21b3314110afdf8a36d84e1e318ae62931e05 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 4 Nov 2022 11:46:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=8E=BB=E6=8E=89mock=E7=9A=84=E5=B0=8F=E9=93=85=E7=AC=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1017964 --user=王孝刚 【接口测试】mock期望 - 响应体中的mock和jmeter函数不生效 https://www.tapd.cn/55049933/s/1288723 --- .../business/commons/json-schema/JsonSchemaEditor.vue | 7 +++++++ .../commons/json-schema/schema/editor/main.vue | 7 +++++++ .../json-schema/schema/editor/mock/MockComplete.vue | 9 ++++++++- .../components/mock/Components/MockApiBody.vue | 5 +++++ .../components/mock/Components/MockApiResponseBody.vue | 5 +++++ .../components/mock/Components/MockRequestParam.vue | 1 + .../components/mock/Components/MockResponseParam.vue | 10 +++++----- 7 files changed, 38 insertions(+), 6 deletions(-) diff --git a/api-test/frontend/src/business/commons/json-schema/JsonSchemaEditor.vue b/api-test/frontend/src/business/commons/json-schema/JsonSchemaEditor.vue index 04fa228e4b..22c2a73b75 100644 --- a/api-test/frontend/src/business/commons/json-schema/JsonSchemaEditor.vue +++ b/api-test/frontend/src/business/commons/json-schema/JsonSchemaEditor.vue @@ -13,6 +13,7 @@ :show-mock-vars="showMockVars" :scenario-definition="scenarioDefinition" @editScenarioAdvance="editScenarioAdvance" + :need-mock="needMock" lang="zh_CN" custom/> @@ -54,6 +55,12 @@ export default { } }, scenarioDefinition: Array, + needMock: { + type: Boolean, + default() { + return true; + } + } }, created() { if (!this.body.jsonSchema && this.body.raw && this.checkIsJson(this.body.raw)) { diff --git a/api-test/frontend/src/business/commons/json-schema/schema/editor/main.vue b/api-test/frontend/src/business/commons/json-schema/schema/editor/main.vue index 98ae6d825e..13ab80684d 100644 --- a/api-test/frontend/src/business/commons/json-schema/schema/editor/main.vue +++ b/api-test/frontend/src/business/commons/json-schema/schema/editor/main.vue @@ -30,6 +30,7 @@ :schema="pickValue" :scenario-definition="scenarioDefinition" :show-mock-vars="showMockVars" + :need-mock="needMock" @editScenarioAdvance="editScenarioAdvance"/> @@ -57,6 +58,7 @@ :disabled="disabled" @editScenarioAdvance="editScenarioAdvance" :lang="lang" :custom="custom" @changeAllItemsType="changeAllItemsType" + :need-mock="needMock" @reloadItems="reloadItems"/> @@ -165,6 +168,10 @@ export default { default: 'zh_CN' }, scenarioDefinition: Array, + needMock: { + type: Boolean, + default: true + }, }, computed: { pickValue() { diff --git a/api-test/frontend/src/business/commons/json-schema/schema/editor/mock/MockComplete.vue b/api-test/frontend/src/business/commons/json-schema/schema/editor/mock/MockComplete.vue index ed0c7c4470..52749053d5 100644 --- a/api-test/frontend/src/business/commons/json-schema/schema/editor/mock/MockComplete.vue +++ b/api-test/frontend/src/business/commons/json-schema/schema/editor/mock/MockComplete.vue @@ -10,7 +10,8 @@ value-key="name" highlight-first-item @select="change"> - + @@ -39,6 +40,12 @@ export default { return false; } }, + needMock: { + type: Boolean, + default() { + return true; + } + } }, data() { return { diff --git a/api-test/frontend/src/business/definition/components/mock/Components/MockApiBody.vue b/api-test/frontend/src/business/definition/components/mock/Components/MockApiBody.vue index 3c50c65711..d1a949e964 100644 --- a/api-test/frontend/src/business/definition/components/mock/Components/MockApiBody.vue +++ b/api-test/frontend/src/business/definition/components/mock/Components/MockApiBody.vue @@ -39,6 +39,7 @@ + :headers="response.headers" :use-post-script="response.usePostScript" + :need-mock="false"/>