refactor(UI测试): 增加基本权限设置

This commit is contained in:
CaptainB 2022-04-02 12:23:53 +08:00 committed by 刘瑞斌
parent 52815a1266
commit c44f282505
11 changed files with 178 additions and 5 deletions

View File

@ -146,6 +146,20 @@ public class PermissionConstants {
public static final String PROJECT_API_SCENARIO_READ_MOVE_BATCH = "PROJECT_API_SCENARIO:READ+MOVE_BATCH";
public static final String PROJECT_API_SCENARIO_READ_CREATE_PERFORMANCE = "PROJECT_API_SCENARIO:READ+CREATE_PERFORMANCE";
public static final String PROJECT_UI_SCENARIO_READ = "PROJECT_UI_SCENARIO:READ";
public static final String PROJECT_UI_SCENARIO_READ_CREATE = "PROJECT_UI_SCENARIO:READ+CREATE";
public static final String PROJECT_UI_SCENARIO_READ_EDIT = "PROJECT_UI_SCENARIO:READ+EDIT";
public static final String PROJECT_UI_SCENARIO_READ_DELETE = "PROJECT_UI_SCENARIO:READ+DELETE";
public static final String PROJECT_UI_SCENARIO_READ_COPY = "PROJECT_UI_SCENARIO:READ+COPY";
public static final String PROJECT_UI_SCENARIO_READ_RUN = "PROJECT_UI_SCENARIO:READ+RUN";
public static final String PROJECT_UI_SCENARIO_READ_DEBUG = "PROJECT_UI_SCENARIO:READ+DEBUG";
public static final String PROJECT_UI_SCENARIO_READ_SCHEDULE = "PROJECT_UI_SCENARIO:READ+SCHEDULE";
public static final String PROJECT_UI_SCENARIO_READ_IMPORT_SCENARIO = "PROJECT_UI_SCENARIO:READ+IMPORT_SCENARIO";
public static final String PROJECT_UI_SCENARIO_READ_EXPORT_SCENARIO = "PROJECT_UI_SCENARIO:READ+EXPORT_SCENARIO";
public static final String PROJECT_UI_SCENARIO_READ_MOVE_BATCH = "PROJECT_UI_SCENARIO:READ+MOVE_BATCH";
public static final String PROJECT_UI_SCENARIO_READ_CREATE_PERFORMANCE = "PROJECT_UI_SCENARIO:READ+CREATE_PERFORMANCE";
public static final String PROJECT_API_REPORT_READ = "PROJECT_API_REPORT:READ";
public static final String PROJECT_API_REPORT_READ_DELETE = "PROJECT_API_REPORT:READ+DELETE";
public static final String PROJECT_API_REPORT_READ_EXPORT = "PROJECT_API_REPORT:READ+EXPORT";

@ -1 +1 @@
Subproject commit 3835c4707e0bfbc3c4883257fccfc94b52d114a9
Subproject commit 37ac323899596b8a20204be8828905173594722d

View File

@ -121,4 +121,34 @@ CREATE PROCEDURE schema_change() BEGIN
END IF;
END//
DELIMITER ;
CALL schema_change();
CALL schema_change();
--
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+DEBUG', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+EXPORT_SCENARIO', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+CREATE', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+BATCH_COPY', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+CREATE_PERFORMANCE_BATCH', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+SCHEDULE', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+CREATE_PERFORMANCE', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+COPY', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+DELETE', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+RUN', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+IMPORT_SCENARIO', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+MOVE_BATCH', 'PROJECT_UI_SCENARIO');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES (UUID(), 'project_admin', 'PROJECT_UI_SCENARIO:READ+EDIT', 'PROJECT_UI_SCENARIO');

View File

@ -760,6 +760,76 @@
"name": "permission.project_api_report.export",
"resourceId": "PROJECT_API_REPORT"
},
{
"id": "PROJECT_UI_SCENARIO:READ",
"name": "permission.project_ui_scenario.read",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+CREATE",
"name": "permission.project_ui_scenario.create",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+EDIT",
"name": "permission.project_api_scenario.edit",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+DELETE",
"name": "permission.project_ui_scenario.delete",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+COPY",
"name": "permission.project_ui_scenario.copy",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+RUN",
"name": "permission.project_ui_scenario.run",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+DEBUG",
"name": "permission.project_ui_scenario.debug",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+SCHEDULE",
"name": "permission.project_ui_scenario.schedule",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+IMPORT_SCENARIO",
"name": "permission.project_ui_scenario.import",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+EXPORT_SCENARIO",
"name": "permission.project_ui_scenario.export",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+MOVE_BATCH",
"name": "permission.project_ui_scenario.move_batch",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+CREATE_PERFORMANCE",
"name": "permission.project_ui_scenario.create_performance",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+CREATE_PERFORMANCE_BATCH",
"name": "permission.project_ui_scenario.create_performance_batch",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_UI_SCENARIO:READ+BATCH_COPY",
"name": "permission.project_ui_scenario.batch_copy",
"resourceId": "PROJECT_UI_SCENARIO"
},
{
"id": "PROJECT_PERFORMANCE_TEST:READ",
"name": "permission.project_performance_test.read",
@ -1100,6 +1170,10 @@
"id": "PROJECT_API_REPORT",
"name": "permission.project_api_report.name"
},
{
"id": "PROJECT_UI_SCENARIO",
"name": "permission.project_ui_scenario.name"
},
{
"id": "PROJECT_PERFORMANCE_TEST",
"name": "permission.project_performance_test.name"

View File

@ -20,7 +20,7 @@
{{ $t('commons.api') }}
</el-menu-item>
<el-menu-item index="/ui" @click="active()" v-if="hasLicense() && check('ui')" onselectstart="return false"
v-permission="['PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ']">
v-permission="['PROJECT_UI_SCENARIO:READ','PROJECT_UI_REPORT:READ']">
{{ $t('commons.ui') }}
</el-menu-item>
<el-menu-item v-if="!hasLicense()" @click="clickPlanMenu">

View File

@ -129,7 +129,7 @@ export default {
}
},
_getUniteMenu() {
let menu = ['TRACK', 'API', 'PERFORMANCE', 'REPORT'];
let menu = ['TRACK', 'API', 'UI', 'PERFORMANCE', 'REPORT'];
for (let i = 0; i < this.tableData.length; i++) {
if (i === 0) {
this.spanArr.push(1);

@ -1 +1 @@
Subproject commit 8ff71061b8aa7bd98b4eb07c7940ef807abae41d
Subproject commit 2b683987e40e132abd1de4ff72fe7f1b80937fa2

View File

@ -149,6 +149,7 @@ export const USER_GROUP_SCOPE = {
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'
}

View File

@ -3019,6 +3019,23 @@ export default {
create_performance_batch: "BATCH CREATE PERFORMANCE",
batch_copy: "BATCH COPY",
},
project_ui_scenario: {
name: "Scenario",
read: "READ",
create: "CREATE",
edit: "EDIT",
delete: "DELETE",
copy: "COPY",
run: "RUN",
debug: "DEBUG",
schedule: "SCHEDULE",
import: "IMPORT",
export: "EXPORT",
move_batch: "MOVE BATCH",
create_performance: "CREATE PERFORMANCE",
create_performance_batch: "BATCH CREATE PERFORMANCE",
batch_copy: "BATCH COPY",
},
project_api_report: {
name: "Report",
read: "READ",
@ -3074,6 +3091,7 @@ export default {
other: {
track: "Track",
api: "API",
ui: "UI",
performance: "Performance",
project: "Project",
report: "Report Statistics"

View File

@ -3023,6 +3023,23 @@ export default {
create_performance_batch: "批量创建性能测试",
batch_copy: "批量复制",
},
project_ui_scenario: {
name: "UI自动化",
read: "查询场景",
create: "创建场景",
edit: "编辑场景",
delete: "删除场景",
copy: "复制场景",
run: "执行场景",
debug: "调试场景",
schedule: "定时任务",
import: "导入场景",
export: "导出场景",
move_batch: "批量移动",
create_performance: "创建性能测试",
create_performance_batch: "批量创建性能测试",
batch_copy: "批量复制",
},
project_api_report: {
name: "测试报告",
read: "查询报告",
@ -3079,6 +3096,7 @@ export default {
other: {
track: "测试跟踪",
api: "接口测试",
ui: "UI测试",
performance: "性能测试",
project: "项目设置",
report: "报表统计",

View File

@ -3022,6 +3022,23 @@ export default {
create_performance_batch: "批量創建性能測試",
batch_copy: "批量復製",
},
project_ui_scenario: {
name: "UI自動化",
read: "查詢場景",
create: "創建場景",
edit: "編輯場景",
delete: "刪除場景",
copy: "復製場景",
run: "執行場景",
debug: "調試場景",
schedule: "定時任務",
import: "導入場景",
export: "導出場景",
move_batch: "批量移動",
create_performance: "創建性能測試",
create_performance_batch: "批量創建性能測試",
batch_copy: "批量復製",
},
project_api_report: {
name: "測試報告",
read: "查詢報告",
@ -3078,6 +3095,7 @@ export default {
other: {
track: "測試跟蹤",
api: "接口測試",
ui: "UI測試",
performance: "性能測試",
project: "項目設置",
report: "報表統計"