From 083fa1c699239b5b371bfce6f7f18ef91f666c44 Mon Sep 17 00:00:00 2001
From: wxg0103 <727495428@qq.com>
Date: Fri, 30 Dec 2022 18:21:32 +0800
Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E5=88=97=E8=A1=A8=E6=98=BE?=
=?UTF-8?q?=E7=A4=BAunexecute=E7=8A=B6=E6=80=81=E7=9A=84=E7=BC=BA=E9=99=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
--bug=1021459 --user=王孝刚 【接口测试】执行场景结果是未执行的时候,最后结果字段显示了unexecute
https://www.tapd.cn/55049933/s/1321706
---
.../api/automation/scenario/ApiScenarioList.vue | 3 +++
.../api/automation/scenario/EditApiScenario.vue | 13 ++++++++++---
.../components/list/ApiCaseSimpleList.vue | 11 +++++++++++
frontend/src/common/js/table-constants.js | 3 ++-
4 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
index 2b1be51643..1356b98e45 100644
--- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
+++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
@@ -218,6 +218,9 @@
{{ $t('api_test.automation.fail') }}
+
+ {{ $t('api_test.home_page.detail_card.unexecute') }}
+
{{ $t('error_report_library.option.name') }}
diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
index 8ab832c517..5de08605bb 100644
--- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
+++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
@@ -2146,14 +2146,21 @@ export default {
}
});
},
- recursionDelete(resourceId, nodes) {
+ getAllCheckedNodes() {
+ if (this.$refs.stepTree) {
+ return this.$refs.stepTree.getCheckedNodes();
+ }
+ return [];
+ },
+ recursionDelete(item, nodes) {
for (let i in nodes) {
if (nodes[i]) {
- if (resourceId === nodes[i].resourceId) {
+ //复制的case的断言的resourceId是一样的,所以要加上parentIndex做唯一标识
+ if (item.resourceId === nodes[i].resourceId && item.parentIndex === nodes[i].parentIndex) {
nodes.splice(i, 1);
} else {
if (nodes[i].hashTree != undefined && nodes[i].hashTree.length > 0) {
- this.recursionDelete(resourceId, nodes[i].hashTree);
+ this.recursionDelete(item, nodes[i].hashTree);
}
}
}
diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue
index d999a54ec6..7c05fbf2e2 100644
--- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue
+++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue
@@ -892,6 +892,14 @@ export default {
}
});
},
+ resetResourceId(hashTree) {
+ hashTree.forEach((item) => {
+ item.resourceId = getUUID();
+ if (item.hashTree && item.hashTree.length > 0) {
+ this.resetResourceId(item.hashTree);
+ }
+ });
+ },
getCaseAndOpen(id, apiName, apiId) {
this.$get('/api/testcase/findById/' + id, (response) => {
let data = response.data;
@@ -903,6 +911,9 @@ export default {
} else if (apiCaseRequest.type === "JDBCSampler") {
apiCaseRequest.method = "SQL";
}
+ if (apiCaseRequest.hashTree && apiCaseRequest.hashTree.length > 0) {
+ this.resetResourceId(apiCaseRequest.hashTree);
+ }
apiCaseRequest.name = apiName;
let obj = {
name: "copy_" + data.name,
diff --git a/frontend/src/common/js/table-constants.js b/frontend/src/common/js/table-constants.js
index e35a76827a..2dba99a1c8 100644
--- a/frontend/src/common/js/table-constants.js
+++ b/frontend/src/common/js/table-constants.js
@@ -148,7 +148,8 @@ export function API_SCENARIO_FILTERS () {
],
RESULT_FILTERS: [
{text: i18n.t('api_test.automation.fail'), value: 'Fail'},
- {text: i18n.t('api_test.automation.success'), value: 'Success'}
+ {text: i18n.t('api_test.automation.success'), value: 'Success'},
+ {text: i18n.t('api_test.home_page.detail_card.unexecute'), value: 'unexecute'}
]
};
/*LEVEL_FILTERS: [