From 8c13cb04734bf2120b1f843f38c03e83be465690 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 11 Aug 2022 11:13:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E8=84=91=E5=9B=BE=E7=94=A8=E4=BE=8B=E6=A0=A1=E9=AA=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015664 --user=宋昌昌 【测试跟踪】脑图模式添加用例,前置条件/备注添加多个仍可以保存 https://www.tapd.cn/55049933/s/1221877 --- .../components/track/common/minder/TestCaseMinder.vue | 8 ++++++++ frontend/src/i18n/en-US.js | 4 +++- frontend/src/i18n/zh-CN.js | 2 ++ frontend/src/i18n/zh-TW.js | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue index 7c15a8ad22..bfa5f47835 100644 --- a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue +++ b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue @@ -464,6 +464,14 @@ name: "TestCaseMinder", let steps = []; let stepNum = 1; if (node.children) { + let prerequisiteNodes = node.children.filter(childNode => childNode.data.resource && childNode.data.resource.indexOf(this.$t('test_track.case.prerequisite')) > -1); + if (prerequisiteNodes.length > 1) { + this.throwError('[' + testCase.name + ']' + this.$t('test_track.case.exists_multiple_prerequisite_node')); + } + let remarkNodes = node.children.filter(childNode => childNode.data.resource && childNode.data.resource.indexOf(this.$t('commons.remark')) > -1); + if (remarkNodes.length > 1) { + this.throwError('[' + testCase.name + ']' + this.$t('test_track.case.exists_multiple_remark_node')); + } node.children.forEach((childNode) => { let childData = childNode.data; if (childData.type === 'issue') return; diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index a02a2dbf17..dd0338a76f 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -2169,7 +2169,9 @@ export default { export_tip: "Switch to Case List and check Use Case Export" }, case_desc: "Case Desc", - passing_rate: 'Case Pass Rate' + passing_rate: 'Case Pass Rate', + exists_multiple_prerequisite_node: "Exists multiple precondition node", + exists_multiple_remark_node: "Exists multiple remark node", }, plan: { test_plan: "Plan", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index a3b86d499d..b4bde4ef2c 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -2171,6 +2171,8 @@ export default { passing_rate: '用例通过率', version: "版本", sync_to_new_version: "复制以下信息到新版本", + exists_multiple_prerequisite_node: "下存在多个前置条件", + exists_multiple_remark_node: "下存在多个备注", }, plan: { test_plan: "测试计划", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 654f4b8d58..2a93b21073 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -2168,6 +2168,8 @@ export default { case_desc: "用例描述", passing_rate: '用例通過率', sync_to_new_version: "復製以下信息到新版本", + exists_multiple_prerequisite_node: "下存在多個前置條件", + exists_multiple_remark_node: "下存在多個備註" }, plan: { test_plan: "測試計劃",