From 75344ff3fc976de20f46b331326e51019260c72a Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 25 Nov 2021 10:37:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=9C=BA=E6=99=AF=E7=94=A8=E4=BE=8B=E5=89=8D?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1008339 --user=lyh 【测试跟踪】测试计划关联场景用例的时候没选择环境也能关联了,也没提示 https://www.tapd.cn/55049933/s/1074891 --- .../view/comonents/api/TestCaseScenarioRelevance.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance.vue index 65cf9eeb2d..8e85faffb4 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseScenarioRelevance.vue @@ -37,6 +37,7 @@ import MsApiScenarioList from "../../../../../api/automation/scenario/ApiScenarioList"; import MsApiScenarioModule from "../../../../../api/automation/scenario/ApiScenarioModule"; import RelevanceScenarioList from "./RelevanceScenarioList"; + import {ENV_TYPE} from "@/common/js/constants"; export default { name: "TestCaseScenarioRelevance", @@ -109,6 +110,17 @@ let map = this.$refs.apiScenarioList.map; let envType = this.$refs.apiScenarioList.environmentType; let envGroupId = this.$refs.apiScenarioList.envGroupId; + if (!map || map.size < 1) { + this.$warning("请选择用例!"); + return false; + } + if (envType === ENV_TYPE.JSON && (!envMap || envMap.size < 1)) { + this.$warning("请选择环境!"); + return false; + } else if (envType === ENV_TYPE.GROUP && !envGroupId) { + this.$warning("请选择环境!"); + return false; + } param.planId = this.planId; param.mapping = strMapToObj(map); param.envMap = strMapToObj(envMap);