refactor(security): 重构安全配置并优化测试环境
- 移除旧的测试套件和UAT测试文件 - 更新密码编码器配置使用BCrypt strength=12 - 添加用户角色关联表和相关服务 - 优化前端日期显示格式 - 清理无用资源和配置文件 - 增强测试数据管理和清理功能
This commit is contained in:
@@ -11,18 +11,20 @@ export class DashboardPage {
|
||||
readonly fileManagementLink: Locator;
|
||||
readonly operationLogLink: Locator;
|
||||
readonly loginLogLink: Locator;
|
||||
readonly dictionaryLink: Locator;
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
this.userInfo = page.locator('.el-avatar');
|
||||
this.userManagementLink = page.getByRole('menuitem', { name: '用户管理' });
|
||||
this.roleManagementLink = page.getByRole('menuitem', { name: '角色管理' });
|
||||
this.menuManagementLink = page.getByRole('menuitem', { name: '菜单管理' });
|
||||
this.systemConfigLink = page.getByRole('menuitem', { name: '参数配置' });
|
||||
this.noticeManagementLink = page.getByRole('menuitem', { name: '通知公告' });
|
||||
this.fileManagementLink = page.getByRole('menuitem', { name: '文件列表' });
|
||||
this.operationLogLink = page.getByRole('menuitem', { name: '操作日志' });
|
||||
this.loginLogLink = page.getByRole('menuitem', { name: '登录日志' });
|
||||
this.userManagementLink = page.locator('.el-menu-item:has-text("用户管理")');
|
||||
this.roleManagementLink = page.locator('.el-menu-item:has-text("角色管理")');
|
||||
this.menuManagementLink = page.locator('.el-menu-item:has-text("菜单管理")');
|
||||
this.systemConfigLink = page.locator('.el-menu-item:has-text("参数配置")');
|
||||
this.noticeManagementLink = page.locator('.el-menu-item:has-text("通知公告")');
|
||||
this.fileManagementLink = page.locator('.el-menu-item:has-text("文件列表")');
|
||||
this.operationLogLink = page.locator('.el-menu-item:has-text("操作日志")');
|
||||
this.loginLogLink = page.locator('.el-menu-item:has-text("登录日志")');
|
||||
this.dictionaryLink = page.locator('.el-menu-item:has-text("字典管理")');
|
||||
}
|
||||
|
||||
async goto() {
|
||||
@@ -31,55 +33,55 @@ export class DashboardPage {
|
||||
}
|
||||
|
||||
async navigateToUserManagement() {
|
||||
const systemMenu = this.page.locator('text=系统管理');
|
||||
const systemMenu = this.page.locator('.el-sub-menu__title:has-text("系统管理")');
|
||||
await systemMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.userManagementLink.click();
|
||||
await this.page.waitForURL('**/users');
|
||||
await this.page.waitForURL('**/users', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToRoleManagement() {
|
||||
const systemMenu = this.page.locator('text=系统管理');
|
||||
const systemMenu = this.page.locator('.el-sub-menu__title:has-text("系统管理")');
|
||||
await systemMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.roleManagementLink.click();
|
||||
await this.page.waitForURL('**/roles');
|
||||
await this.page.waitForURL('**/roles', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToMenuManagement() {
|
||||
const systemMenu = this.page.locator('text=系统管理');
|
||||
const systemMenu = this.page.locator('.el-sub-menu__title:has-text("系统管理")');
|
||||
await systemMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.menuManagementLink.click();
|
||||
await this.page.waitForURL('**/menus');
|
||||
await this.page.waitForURL('**/menus', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToSystemConfig() {
|
||||
const configMenu = this.page.locator('text=系统配置');
|
||||
const configMenu = this.page.locator('.el-sub-menu__title:has-text("系统配置")');
|
||||
await configMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.systemConfigLink.click();
|
||||
await this.page.waitForURL('**/sysconfig');
|
||||
await this.page.waitForURL('**/sys/config', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToNoticeManagement() {
|
||||
const notifyMenu = this.page.locator('text=通知中心');
|
||||
const notifyMenu = this.page.locator('.el-sub-menu__title:has-text("通知中心")');
|
||||
await notifyMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.noticeManagementLink.click();
|
||||
await this.page.waitForURL('**/notice');
|
||||
await this.page.waitForURL('**/notice', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToFileManagement() {
|
||||
const fileMenu = this.page.locator('text=文件管理');
|
||||
const fileMenu = this.page.locator('.el-sub-menu__title:has-text("文件管理")');
|
||||
await fileMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.fileManagementLink.click();
|
||||
await this.page.waitForURL('**/files');
|
||||
await this.page.waitForURL('**/files', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToAudit() {
|
||||
const auditMenu = this.page.locator('text=审计中心');
|
||||
const auditMenu = this.page.locator('.el-sub-menu__title:has-text("审计中心")');
|
||||
await auditMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
}
|
||||
@@ -87,13 +89,29 @@ export class DashboardPage {
|
||||
async navigateToOperationLog() {
|
||||
await this.navigateToAudit();
|
||||
await this.operationLogLink.click();
|
||||
await this.page.waitForURL('**/oplog');
|
||||
await this.page.waitForURL('**/oplog', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToLoginLog() {
|
||||
await this.navigateToAudit();
|
||||
await this.loginLogLink.click();
|
||||
await this.page.waitForURL('**/loginlog');
|
||||
await this.page.waitForURL('**/loginlog', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToNotification() {
|
||||
const notifyMenu = this.page.locator('.el-sub-menu__title:has-text("通知中心")');
|
||||
await notifyMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.noticeManagementLink.click();
|
||||
await this.page.waitForURL('**/notification', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async navigateToDictionary() {
|
||||
const configMenu = this.page.locator('.el-sub-menu__title:has-text("系统配置")');
|
||||
await configMenu.click();
|
||||
await this.page.waitForTimeout(500);
|
||||
await this.dictionaryLink.click();
|
||||
await this.page.waitForURL('**/dict', { timeout: 10000 });
|
||||
}
|
||||
|
||||
async getUsername(): Promise<string | null> {
|
||||
|
||||
Reference in New Issue
Block a user