From 4907534169127ea90a0cefd92dd339bc586e18be Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 14 Jul 2022 17:16:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=87=8D=E5=A4=8D=E7=82=B9=E5=87=BBcase?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014874 --user=王孝刚 【接口测试】多次点击接口case列表执行按钮页面提示不友好 https://www.tapd.cn/55049933/s/1202115 --- .../api/definition/components/Run.vue | 20 ++++++++++++++----- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/Run.vue b/frontend/src/business/components/api/definition/components/Run.vue index 18ae4679f9..8720cccfa4 100644 --- a/frontend/src/business/components/api/definition/components/Run.vue +++ b/frontend/src/business/components/api/definition/components/Run.vue @@ -54,13 +54,13 @@ export default { this.websocket.onmessage = this.onMessages; this.websocket.onerror = this.onError; }, - onError(){ + onError() { this.$emit('runRefresh', ""); - this.$error("The connection is abnormal, please check the environment configuration"); + this.$error(this.$t('api_test.automation.rerun_warning')); }, onMessages(e) { // 确认连接建立成功,开始执行 - if(e && e.data === "CONN_SUCCEEDED"){ + if (e && e.data === "CONN_SUCCEEDED") { this.run(); } @@ -84,7 +84,10 @@ export default { stepArray[i].clazzName = TYPE_TO_C.get(stepArray[i].type); } if (stepArray[i].type === "Assertions" && !stepArray[i].document) { - stepArray[i].document = {type: "JSON", data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []}}; + stepArray[i].document = { + type: "JSON", + data: {xmlFollowAPI: false, jsonFollowAPI: false, json: [], xml: []} + }; } if (stepArray[i] && stepArray[i].authManager && !stepArray[i].authManager.clazzName) { stepArray[i].authManager.clazzName = TYPE_TO_C.get(stepArray[i].authManager.type); @@ -122,7 +125,14 @@ export default { }) this.sort(testPlan.hashTree); this.requestResult.reportId = this.reportId; - let reqObj = {id: this.reportId, testElement: testPlan, type: this.type, clazzName: this.clazzName ? this.clazzName : TYPE_TO_C.get(this.type), projectId: projectId, environmentMap: strMapToObj(this.envMap)}; + let reqObj = { + id: this.reportId, + testElement: testPlan, + type: this.type, + clazzName: this.clazzName ? this.clazzName : TYPE_TO_C.get(this.type), + projectId: projectId, + environmentMap: strMapToObj(this.envMap) + }; let bodyFiles = getBodyUploadFiles(reqObj, this.runData); reqObj.editCaseRequest = this.editCaseRequest; reqObj.debug = this.debug; diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index a4bfa44114..bbec4e7e72 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -1440,6 +1440,7 @@ export default { request_error: "error", generate_report: "Generate report", rerun: "fail and rerun", + rerun_warning: "The connection is abnormal, please check the environment configuration", }, environment: { id: 'Environment ID', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 1cbb81f6ad..1279913371 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -1445,6 +1445,7 @@ export default { request_error: "失败", generate_report: "生成报告", rerun: "失败重跑", + rerun_warning: "连接异常,请检查环境配置", }, environment: { id: '环境ID', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 7846c85e15..1a135bc9f0 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -1445,6 +1445,7 @@ export default { request_error: "失敗", generate_report: "生成報告", rerun: "失敗重跑", + rerun_warning: "連接異常,請檢查環境配置", }, environment: { id: '環境ID',