diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/TestPlanApiCaseDTO.java b/backend/src/main/java/io/metersphere/api/dto/definition/TestPlanApiCaseDTO.java index 8881b5d07b..53bb34fa5f 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/TestPlanApiCaseDTO.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/TestPlanApiCaseDTO.java @@ -10,4 +10,5 @@ public class TestPlanApiCaseDTO extends ApiTestCaseDTO { private String environmentId; private String caseId; private String execResult; + private String userId; } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml index 1fe0c1355d..78c9790a70 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanApiCaseMapper.xml @@ -17,15 +17,16 @@ select test_case_review_test_case.id as id, test_case_review_test_case.reviewer, test_case_review_test_case.update_time, test_case_review_test_case.review_id as reviewId, - test_case.id as caseId, test_case.name, test_case.priority, test_case.test_id as testId, - test_case.type, test_case.node_path, test_case.method, if(project.custom_num = 0, cast(test_case.num as char), test_case.custom_num) as customNum, test_case.review_status, - test_case.remark as remark, test_case.steps as steps, test_case.node_id as nodeId, + test_case.id as caseId, test_case.name, test_case.priority, test_case.test_id as testId, + test_case.type, test_case.node_path, test_case.method, if(project.custom_num = 0, cast(test_case.num as char), + test_case.custom_num) as customNum, test_case.review_status, + test_case.remark as remark, test_case.maintainer, test_case.steps as steps, test_case.node_id as nodeId, test_case_node.name as model, project.name as projectName from test_case_review_test_case diff --git a/backend/src/main/resources/db/migration/V86__v1.10.1_release.sql b/backend/src/main/resources/db/migration/V86__v1.10.1_release.sql index 23e6d823b2..9e7da65514 100644 --- a/backend/src/main/resources/db/migration/V86__v1.10.1_release.sql +++ b/backend/src/main/resources/db/migration/V86__v1.10.1_release.sql @@ -37,38 +37,48 @@ DROP PROCEDURE IF EXISTS project_systemid; -- 清空system_header表 truncate table system_header; + insert into system_header (type, props) values ('api_scenario_list', '[{"id":"num","label":"ID"},{"id":"name","label":"场景名称"},{"id":"level","label":"用例等级"},{"id":"status","label":"当前状态"},{"id":"tags","label":"标签"},{"id":"principal","label":"负责人"},{"id":"updateTime","label":"最后更新时间"},{"id":"stepTotal","label":"步骤数"},{"id":"lastResult","label":"最后结果"},{"id":"passRate","label":"通过率"}]'); + insert into system_header (type, props) values ('test_plan_function_test_case', '[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"type","label":"类型"},{"id":"tags","label":"标签"},{"id":"nodePath","label":"所属模块"},{"id":"projectName","label":"所属项目"},{"id":"issuesContent","label":"缺陷"},{"id":"executorName","label":"执行人"},{"id":"status","label":"执行结果"},{"id":"updateTime","label":"更新时间"},{"id":"maintainer","label":"责任人"}]'); insert into system_header (type, props) values ('test_case_review_case_list', '[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"type","label":"类型"},{"id":"method","label":"测试方式"},{"id":"nodePath","label":"所属模块"},{"id":"projectName","label":"所属项目"},{"id":"reviewerName","label":"评审人"},{"id":"reviewStatus","label":"评审状态"},{"id":"updateTime","label":"更新时间"}]'); + insert into system_header (type, props) values ('test_plan_load_case', '[{"id":"num","label":"ID"},{"id":"caseName","label":"名称"},{"id":"projectName","label":"所属项目"},{"id":"userName","label":"创建人"},{"id":"createTime","label":"创建时间"},{"id":"status","label":"状态"},{"id":"caseStatus","label":"执行状态"},{"id":"loadReportId","label":"查看报告"}]'); + insert into system_header (type, props) values ('api_case_list', '[{"id":"num","label":"ID"},{"id":"name","label":"用例名称"},{"id":"priority","label":"用例等级"},{"id":"path","label":"路径"},{"id":"tags","label":"标签"},{"id":"createUser","label":"创建人"},{"id":"updateTime","label":"最后更新时间"}]'); + insert into system_header (type, props) values ('api_list', '[{"id":"num","label":"ID"},{"id":"status","label":"接口状态"},{"id":"name","label":"接口名称"},{"id":"method","label":"请求类型"},{"id":"userName","label":"负责人"},{"id":"path","label":"路径"},{"id":"tags","label":"标签"},{"id":"updateTime","label":"最后更新时间"},{"id":"caseTotal","label":"用例数"},{"id":"caseStatus","label":"用例状态"},{"id":"casePassingRate","label":"用例通过率"}]'); + insert into system_header (type, props) values ('test_case_review_list', '[{"id":"name","label":"评审名称"},{"id":"reviewer","label":"评审人"},{"id":"projectName","label":"所属项目"},{"id":"creatorName","label":"发起人"},{"id":"status","label":"当前状态"},{"id":"createTime","label":"创建时间"},{"id":"endTime","label":"截止时间"},{"id":"tags","label":"标签"}]'); + insert into system_header (type, props) values ('test_plan_api_case', '[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"path","label":"路径"},{"id":"createUser","label":"创建人"},{"id":"custom","label":"最后更新时间"},{"id":"tags","label":"标签"},{"id":"execResult","label":"执行状态"}]'); + insert into system_header (type, props) values ('test_plan_list', '[{"id":"name","label":"名称"},{"id":"userName","label":"负责人"},{"id":"createUser","label":"创建人"},{"id":"status","label":"当前状态"},{"id":"stage","label":"测试阶段"},{"id":"testRate","label":"测试进度"},{"id":"projectName","label":"所属项目"},{"id":"plannedStartTime","label":"计划开始"}, {"id":"plannedEndTime","label":"计划结束"},{"id":"actualStartTime","label":"实际开始"}, {"id":"actualEndTime","label":"实际结束"},{"id":"tags","label":"标签"}, {"id":"executionTimes","label":"执行次数"},{"id":"passRate","label":"通过率"}]'); + insert into system_header (type, props) values ('test_case_list', '[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"createUser","label":"创建人"},{"id":"priority","label":"用例等级"},{"id":"reviewStatus","label":"评审状态"},{"id":"tags","label":"标签"},{"id":"nodePath","label":"所属模块"},{"id":"updateTime","label":"更新时间"}]'); + insert into system_header (type, props) values ('test_plan_scenario_case', '[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"level","label":"用例等级"},{"id":"tagNames","label":"标签"},{"id":"userId","label":"创建人"},{"id":"updateTime","label":"最后更新时间"},{"id":"stepTotal","label":"通过"},{"id":"lastResult","label":"失败"},{"id":"passRate","label":"通过率"}]'); @@ -78,4 +88,19 @@ alter table api_definition alter table api_definition add case_status varchar(100) null; alter table api_definition - add case_passing_rate varchar(100) null; \ No newline at end of file + add case_passing_rate varchar(100) null; + +-- 测试用例表头添加责任人 + +update system_header +set props='[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"type","label":"类型"},{"id":"method","label":"测试方式"},{"id":"nodePath","label":"所属模块"},{"id":"projectName","label":"所属项目"},{"id":"reviewerName","label":"评审人"},{"id":"maintainer","label":"责任人"},{"id":"reviewStatus","label":"评审状态"},{"id":"updateTime","label":"更新时间"}]' +where type = 'test_case_review_case_list'; +update system_header +set props='[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"priority","label":"用例等级"},{"id":"path","label":"路径"},{"id":"createUser","label":"创建人"},{"id":"maintainer","label":"责任人"},{"id":"custom","label":"最后更新时间"},{"id":"tags","label":"标签"},{"id":"execResult","label":"执行状态"}]' +where type = 'test_plan_api_case'; +update system_header +set props='[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"level","label":"用例等级"},{"id":"tagNames","label":"标签"},{"id":"userId","label":"创建人"},{"id":"maintainer","label":"责任人"},{"id":"updateTime","label":"最后更新时间"},{"id":"stepTotal","label":"通过"},{"id":"lastResult","label":"失败"},{"id":"passRate","label":"通过率"}]' +where type = 'test_plan_scenario_case'; +update system_header +set props='[{"id":"num","label":"ID"},{"id":"name","label":"名称"},{"id":"createUser","label":"创建人"},{"id":"maintainer","label":"责任人"},{"id":"priority","label":"用例等级"},{"id":"reviewStatus","label":"评审状态"},{"id":"tags","label":"标签"},{"id":"nodePath","label":"所属模块"},{"id":"updateTime","label":"更新时间"}]' +where type = 'test_case_list'; diff --git a/frontend/src/business/components/common/model/JsonData.js b/frontend/src/business/components/common/model/JsonData.js index b1abc5d731..a62e8a80be 100644 --- a/frontend/src/business/components/common/model/JsonData.js +++ b/frontend/src/business/components/common/model/JsonData.js @@ -10,6 +10,7 @@ export const Track_Test_Case = [ {id: 'nodePath', label: i18n.t('test_track.case.module')}, {id: 'updateTime', label: i18n.t('commons.update_time')}, {id: 'createUser', label: i18n.t('commons.create_user')}, + {id: 'maintainer', label: i18n.t('custom_field.case_maintainer')}, ] //用例评审-测试用例 export const Test_Case_Review = [ @@ -91,6 +92,7 @@ export const Test_Case_Review_Case_List = [ {id: 'reviewerName', label: i18n.t('test_track.review.reviewer')}, {id: 'reviewStatus', label: i18n.t('test_track.case.status')}, {id: 'updateTime', label: i18n.t('commons.update_time')}, + {id: 'maintainer', label: i18n.t('custom_field.case_maintainer')}, ] //测试计划-功能用例 export const Test_Plan_Function_Test_Case = [ @@ -117,6 +119,8 @@ export const Test_Plan_Api_Case = [ {id: 'custom', label: i18n.t('api_test.definition.api_last_time')}, {id: 'tags', label: i18n.t('commons.tag')}, {id: 'execResult', label: '执行状态'}, + {id: 'maintainer', label: i18n.t('api_test.definition.request.responsible')} + ] //测试计划-性能用例 export const Test_Plan_Load_Case = [ @@ -140,5 +144,7 @@ export const Test_Plan_Scenario_Case = [ {id: 'stepTotal', label: i18n.t('api_test.automation.success')}, {id: 'lastResult', label: i18n.t('api_test.automation.fail')}, {id: 'passRate', label: i18n.t('api_test.automation.passing_rate')}, + {id: 'maintainer', label: i18n.t('api_test.definition.request.responsible')} + ] diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index a0fb3351d5..d2234d9dc1 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -71,6 +71,15 @@ min-width="120" > + + + + - + + {{ scope.row.updateTime | timestampFormatDate }} - + v-if="item.id == 'type'" + prop="type" + :filters="typeFilters" + column-key="type" + min-width="100" + :label="$t('test_track.case.type')" + show-overflow-tooltip + :key="index"> - + +