From fdfe1955876ebb5a81db8db576a6444a40958c05 Mon Sep 17 00:00:00 2001 From: MeterSphere Bot <78466014+metersphere-bot@users.noreply.github.com> Date: Tue, 2 Aug 2022 18:38:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=89=A7=E8=A1=8C=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=98=BE=E7=A4=BA=E4=BA=86unexecute=E7=9A=84=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=20(#16610)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015580 --user=王孝刚 【接口测试】场景执行结果显示了unexecute等2个问题优化 https://www.tapd.cn/55049933/s/1217625 Co-authored-by: wxg0103 <727495428@qq.com> --- .../api/service/ApiAutomationService.java | 2 + .../automation/scenario/ApiScenarioList.vue | 8 + frontend/src/common/js/table-constants.js | 262 +++++++++--------- 3 files changed, 142 insertions(+), 130 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index a4d183c251..9d0f594233 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -515,6 +515,7 @@ public class ApiAutomationService { } else { scenario.setVersionId(request.getVersionId()); } + scenario.setLastResult(""); return scenario; } @@ -1325,6 +1326,7 @@ public class ApiAutomationService { scenarioWithBLOBs.setUserId(request.getUserId()); } scenarioWithBLOBs.setDescription(request.getDescription()); + scenarioWithBLOBs.setLastResult(""); Boolean openCustomNum = apiTestImportRequest.getOpenCustomNum(); List list = new ArrayList<>(); diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index 3bb5f019d3..d9226e94e5 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -224,6 +224,10 @@ v-else-if="row.lastResult === 'errorReportResult'"> {{ $t('error_report_library.option.name') }} + + {{ $t('api_test.home_page.detail_card.unexecute') }} + @@ -731,6 +735,10 @@ export default { this.condition.filters = {status: ["Prepare", "Underway", "Completed"]}; } + if (this.condition.filters.last_result && this.condition.filters.last_result.indexOf('unexecute') !== -1) { + this.condition.filters.last_result.push(''); + } + // todo if (projectId != null && typeof projectId === 'string') { this.condition.projectId = projectId; diff --git a/frontend/src/common/js/table-constants.js b/frontend/src/common/js/table-constants.js index 72cfaa63b8..30abe3e6d8 100644 --- a/frontend/src/common/js/table-constants.js +++ b/frontend/src/common/js/table-constants.js @@ -3,184 +3,186 @@ import i18n from "@/i18n/i18n"; import {AZURE_DEVOPS, JIRA, LOCAL, TAPD, ZEN_TAO} from "@/common/js/constants"; export const CUSTOM_FIELD_TYPE_OPTION = [ - {value: 'input', text: 'workspace.custom_filed.input'}, - {value: 'textarea', text: 'workspace.custom_filed.textarea'}, - {value: 'select', text: 'workspace.custom_filed.select', hasOption: true}, - {value: 'multipleSelect', text: 'workspace.custom_filed.multipleSelect', hasOption: true}, - {value: 'radio', text: 'workspace.custom_filed.radio', hasOption: true}, - {value: 'checkbox', text: 'workspace.custom_filed.checkbox', hasOption: true}, - {value: 'member', text: 'workspace.custom_filed.member', hasOption: true}, - {value: 'multipleMember', text: 'workspace.custom_filed.multipleMember', hasOption: true}, - {value: 'date', text: 'workspace.custom_filed.date'}, - {value: 'datetime', text: 'workspace.custom_filed.datetime'}, - {value: 'richText', text: 'workspace.custom_filed.richText'}, - {value: 'int', text: 'workspace.custom_filed.int'}, - {value: 'float', text: 'workspace.custom_filed.float'}, - {value: 'multipleInput', text: 'workspace.custom_filed.multipleInput'} + {value: 'input', text: 'workspace.custom_filed.input'}, + {value: 'textarea', text: 'workspace.custom_filed.textarea'}, + {value: 'select', text: 'workspace.custom_filed.select', hasOption: true}, + {value: 'multipleSelect', text: 'workspace.custom_filed.multipleSelect', hasOption: true}, + {value: 'radio', text: 'workspace.custom_filed.radio', hasOption: true}, + {value: 'checkbox', text: 'workspace.custom_filed.checkbox', hasOption: true}, + {value: 'member', text: 'workspace.custom_filed.member', hasOption: true}, + {value: 'multipleMember', text: 'workspace.custom_filed.multipleMember', hasOption: true}, + {value: 'date', text: 'workspace.custom_filed.date'}, + {value: 'datetime', text: 'workspace.custom_filed.datetime'}, + {value: 'richText', text: 'workspace.custom_filed.richText'}, + {value: 'int', text: 'workspace.custom_filed.int'}, + {value: 'float', text: 'workspace.custom_filed.float'}, + {value: 'multipleInput', text: 'workspace.custom_filed.multipleInput'} ]; export function CUSTOM_FIELD_TYPE_FILTERS(_this) { - return [ - {value: 'input', text: _this.$t('workspace.custom_filed.input')}, - {value: 'textarea', text: _this.$t('workspace.custom_filed.textarea')}, - {value: 'select', text: _this.$t('workspace.custom_filed.select')}, - {value: 'multipleSelect', text: _this.$t('workspace.custom_filed.multipleSelect')}, - {value: 'radio', text: _this.$t('workspace.custom_filed.radio')}, - {value: 'checkbox', text: _this.$t('workspace.custom_filed.checkbox')}, - {value: 'member', text: _this.$t('workspace.custom_filed.member')}, - {value: 'multipleMember', text: _this.$t('workspace.custom_filed.multipleMember')}, - {value: 'date', text: _this.$t('workspace.custom_filed.date')}, - {value: 'datetime', text: _this.$t('workspace.custom_filed.datetime')}, - {value: 'richText', text: _this.$t('workspace.custom_filed.richText')}, - {value: 'int', text: _this.$t('workspace.custom_filed.int')}, - {value: 'float', text: _this.$t('workspace.custom_filed.float')}, - {value: 'multipleInput', text: _this.$t('workspace.custom_filed.multipleInput')} - ]; + return [ + {value: 'input', text: _this.$t('workspace.custom_filed.input')}, + {value: 'textarea', text: _this.$t('workspace.custom_filed.textarea')}, + {value: 'select', text: _this.$t('workspace.custom_filed.select')}, + {value: 'multipleSelect', text: _this.$t('workspace.custom_filed.multipleSelect')}, + {value: 'radio', text: _this.$t('workspace.custom_filed.radio')}, + {value: 'checkbox', text: _this.$t('workspace.custom_filed.checkbox')}, + {value: 'member', text: _this.$t('workspace.custom_filed.member')}, + {value: 'multipleMember', text: _this.$t('workspace.custom_filed.multipleMember')}, + {value: 'date', text: _this.$t('workspace.custom_filed.date')}, + {value: 'datetime', text: _this.$t('workspace.custom_filed.datetime')}, + {value: 'richText', text: _this.$t('workspace.custom_filed.richText')}, + {value: 'int', text: _this.$t('workspace.custom_filed.int')}, + {value: 'float', text: _this.$t('workspace.custom_filed.float')}, + {value: 'multipleInput', text: _this.$t('workspace.custom_filed.multipleInput')} + ]; } export const UI_ELEMENT_LOCATION_TYPE_OPTION = [ - {value: 'id', text: 'id'}, - {value: 'name', text: 'name'}, - {value: 'className', text: 'class'}, - {value: 'tagName', text: 'tag'}, - {value: 'linkText', text: 'linkText'}, - {value: 'partialLinkText', text: 'plink'}, - {value: 'css', text: 'css'}, - {value: 'xpath', text: 'xpath'}, - {value: 'label', text: 'label'}, - {value: 'value', text: 'value'}, - {value: 'index', text: 'index'}, + {value: 'id', text: 'id'}, + {value: 'name', text: 'name'}, + {value: 'className', text: 'class'}, + {value: 'tagName', text: 'tag'}, + {value: 'linkText', text: 'linkText'}, + {value: 'partialLinkText', text: 'plink'}, + {value: 'css', text: 'css'}, + {value: 'xpath', text: 'xpath'}, + {value: 'label', text: 'label'}, + {value: 'value', text: 'value'}, + {value: 'index', text: 'index'}, ]; export const CUSTOM_FIELD_SCENE_OPTION = [ - {value: 'TEST_CASE', text: 'workspace.case_template_manage'}, - {value: 'ISSUE', text: 'workspace.issue_template_manage'}, + {value: 'TEST_CASE', text: 'workspace.case_template_manage'}, + {value: 'ISSUE', text: 'workspace.issue_template_manage'}, ]; export function CASE_TYPE_OPTION() { - return [ - {value: 'functional', text: i18n.t('api_test.home_page.failed_case_list.table_value.case_type.functional')}, - ]; + return [ + {value: 'functional', text: i18n.t('api_test.home_page.failed_case_list.table_value.case_type.functional')}, + ]; } export const ISSUE_PLATFORM_OPTION = [ - {value: LOCAL, text: 'Metersphere'}, - {value: TAPD, text: 'Tapd'}, - {value: JIRA, text: 'JIRA'}, - {value: ZEN_TAO, text: 'Zentao'}, - {value: AZURE_DEVOPS, text: 'Azure Devops'}, + {value: LOCAL, text: 'Metersphere'}, + {value: TAPD, text: 'Tapd'}, + {value: JIRA, text: 'JIRA'}, + {value: ZEN_TAO, text: 'Zentao'}, + {value: AZURE_DEVOPS, text: 'Azure Devops'}, ]; export const FIELD_TYPE_MAP = { - input: 'workspace.custom_filed.input', - textarea: 'workspace.custom_filed.textarea', - select: 'workspace.custom_filed.select', - multipleSelect: 'workspace.custom_filed.multipleSelect', - radio: 'workspace.custom_filed.radio', - checkbox: 'workspace.custom_filed.checkbox', - member: 'workspace.custom_filed.member', - multipleMember: 'workspace.custom_filed.multipleMember', - date: 'workspace.custom_filed.date', - datetime: 'workspace.custom_filed.datetime', - richText: 'workspace.custom_filed.richText', - int: 'workspace.custom_filed.int', - float: 'workspace.custom_filed.float', - multipleInput: 'workspace.custom_filed.multipleInput' + input: 'workspace.custom_filed.input', + textarea: 'workspace.custom_filed.textarea', + select: 'workspace.custom_filed.select', + multipleSelect: 'workspace.custom_filed.multipleSelect', + radio: 'workspace.custom_filed.radio', + checkbox: 'workspace.custom_filed.checkbox', + member: 'workspace.custom_filed.member', + multipleMember: 'workspace.custom_filed.multipleMember', + date: 'workspace.custom_filed.date', + datetime: 'workspace.custom_filed.datetime', + richText: 'workspace.custom_filed.richText', + int: 'workspace.custom_filed.int', + float: 'workspace.custom_filed.float', + multipleInput: 'workspace.custom_filed.multipleInput' }; export const SCENE_MAP = { - ISSUE: 'workspace.issue_template_manage', - TEST_CASE: 'workspace.case_template_manage', - PLAN: 'workstation.table_name.track_plan' + ISSUE: 'workspace.issue_template_manage', + TEST_CASE: 'workspace.case_template_manage', + PLAN: 'workstation.table_name.track_plan' }; export const SYSTEM_FIELD_NAME_MAP = { - //用例字段 - 用例状态: 'custom_field.case_status', - 责任人: 'custom_field.case_maintainer', - 用例等级: 'custom_field.case_priority', - //缺陷字段 - 创建人: 'custom_field.issue_creator', - 处理人: 'custom_field.issue_processor', - 状态: 'custom_field.issue_status', - 严重程度: 'custom_field.issue_severity', - // 测试计划 - 测试阶段: 'test_track.plan.plan_stage' + //用例字段 + 用例状态: 'custom_field.case_status', + 责任人: 'custom_field.case_maintainer', + 用例等级: 'custom_field.case_priority', + //缺陷字段 + 创建人: 'custom_field.issue_creator', + 处理人: 'custom_field.issue_processor', + 状态: 'custom_field.issue_status', + 严重程度: 'custom_field.issue_severity', + // 测试计划 + 测试阶段: 'test_track.plan.plan_stage' } export const ISSUE_STATUS_MAP = { - 'new': i18n.t('test_track.issue.status_new'), - 'closed': i18n.t('test_track.issue.status_closed'), - 'resolved': i18n.t('test_track.issue.status_resolved'), - 'active': i18n.t('test_track.issue.status_active'), - 'delete': i18n.t('test_track.issue.status_delete'), - 'created': i18n.t('test_track.issue.status_new') + 'new': i18n.t('test_track.issue.status_new'), + 'closed': i18n.t('test_track.issue.status_closed'), + 'resolved': i18n.t('test_track.issue.status_resolved'), + 'active': i18n.t('test_track.issue.status_active'), + 'delete': i18n.t('test_track.issue.status_delete'), + 'created': i18n.t('test_track.issue.status_new') } export const TAPD_ISSUE_STATUS_MAP = { - 'new': i18n.t('test_track.issue.tapd_status_new'), - 'in_progress': i18n.t('test_track.issue.tapd_status_in_progress'), - 'reopened': i18n.t('test_track.issue.tapd_status_reopened'), - 'rejected': i18n.t('test_track.issue.tapd_status_rejected'), - 'verified': i18n.t('test_track.issue.tapd_status_verified'), - 'closed': i18n.t('test_track.issue.tapd_status_closed'), - 'resolved': i18n.t('test_track.issue.tapd_status_resolved') + 'new': i18n.t('test_track.issue.tapd_status_new'), + 'in_progress': i18n.t('test_track.issue.tapd_status_in_progress'), + 'reopened': i18n.t('test_track.issue.tapd_status_reopened'), + 'rejected': i18n.t('test_track.issue.tapd_status_rejected'), + 'verified': i18n.t('test_track.issue.tapd_status_verified'), + 'closed': i18n.t('test_track.issue.tapd_status_closed'), + 'resolved': i18n.t('test_track.issue.tapd_status_resolved') } export function API_SCENARIO_FILTERS() { - return { - STATUS_FILTERS: [ - {text: i18n.t('test_track.plan.plan_status_prepare'), value: 'Prepare'}, - {text: i18n.t('test_track.plan.plan_status_running'), value: 'Underway'}, - {text: i18n.t('test_track.plan.plan_status_completed'), value: 'Completed'}, - ], - TRASH_FILTERS: [ - {text: i18n.t('test_track.plan.plan_status_trash'), value: 'Trash'}, - ], + return { + STATUS_FILTERS: [ + {text: i18n.t('test_track.plan.plan_status_prepare'), value: 'Prepare'}, + {text: i18n.t('test_track.plan.plan_status_running'), value: 'Underway'}, + {text: i18n.t('test_track.plan.plan_status_completed'), value: 'Completed'}, + ], + TRASH_FILTERS: [ + {text: i18n.t('test_track.plan.plan_status_trash'), value: 'Trash'}, + ], - LEVEL_FILTERS: [ + LEVEL_FILTERS: [ + {text: 'P0', value: 'P0'}, + {text: 'P1', value: 'P1'}, + {text: 'P2', value: 'P2'}, + {text: 'P3', value: 'P3'} + ], + 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.home_page.detail_card.unexecute'), value: 'unexecute'}, + {text: i18n.t('error_report_library.option.name'), value: 'errorReportResult'} + ] + }; + /*LEVEL_FILTERS: [ {text: 'P0', value: 'P0'}, {text: 'P1', value: 'P1'}, {text: 'P2', value: 'P2'}, {text: 'P3', value: 'P3'} - ], + ]; RESULT_FILTERS: [ {text: i18n.t('api_test.automation.fail'), value: 'Fail'}, {text: i18n.t('api_test.automation.success'), value: 'Success'} - ] - }; - /*LEVEL_FILTERS: [ - {text: 'P0', value: 'P0'}, - {text: 'P1', value: 'P1'}, - {text: 'P2', value: 'P2'}, - {text: 'P3', value: 'P3'} - ]; - RESULT_FILTERS: [ - {text: i18n.t('api_test.automation.fail'), value: 'Fail'}, - {text: i18n.t('api_test.automation.success'), value: 'Success'} - ];*/ + ];*/ - /*STATUS_FILTERS: [ - {text: i18n.t('test_track.plan.plan_status_prepare'), value: 'Prepare'}, - {text: i18n.t('test_track.plan.plan_status_running'), value: 'Underway'}, - {text: i18n.t('test_track.plan.plan_status_completed'), value: 'Completed'}, - {text: i18n.t('test_track.plan.plan_status_trash'), value: 'Trash'}, - ],*/ + /*STATUS_FILTERS: [ + {text: i18n.t('test_track.plan.plan_status_prepare'), value: 'Prepare'}, + {text: i18n.t('test_track.plan.plan_status_running'), value: 'Underway'}, + {text: i18n.t('test_track.plan.plan_status_completed'), value: 'Completed'}, + {text: i18n.t('test_track.plan.plan_status_trash'), value: 'Trash'}, + ],*/ } export const USER_GROUP_SCOPE = { - 'SYSTEM': 'group.system', - 'WORKSPACE': 'group.workspace', - 'PROJECT': 'group.project', - 'PERSONAL': 'group.personal' + 'SYSTEM': 'group.system', + 'WORKSPACE': 'group.workspace', + 'PROJECT': 'group.project', + 'PERSONAL': 'group.personal' } export const PROJECT_GROUP_SCOPE = { - 'TRACK': 'permission.other.track', - 'API': 'permission.other.api', - 'UI': 'permission.other.ui', - 'PERFORMANCE': 'permission.other.performance', - 'REPORT': 'permission.other.report' + 'TRACK': 'permission.other.track', + 'API': 'permission.other.api', + 'UI': 'permission.other.ui', + 'PERFORMANCE': 'permission.other.performance', + 'REPORT': 'permission.other.report' }