You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.4 KiB
94 lines
2.4 KiB
export const TEST_CONFIG = {
|
|
// 测试环境配置
|
|
baseURL: 'http://localhost:5173', // Vite 开发服务器
|
|
apiURL: 'http://localhost:8888/api/v1',
|
|
|
|
// 测试用户凭证
|
|
testUser: {
|
|
email: 'admin@example.com',
|
|
password: 'password123',
|
|
},
|
|
|
|
// 超级管理员凭证(由种子逻辑创建)
|
|
superAdmin: {
|
|
account: 'admin',
|
|
password: 'admin123',
|
|
},
|
|
|
|
// 测试超时配置
|
|
timeouts: {
|
|
navigation: 10000,
|
|
element: 5000,
|
|
api: 5000,
|
|
},
|
|
};
|
|
|
|
// 页面路由
|
|
export const ROUTES = {
|
|
login: '/login',
|
|
dashboard: '/dashboard',
|
|
users: '/users',
|
|
files: '/files',
|
|
settings: '/settings',
|
|
my: '/my',
|
|
menus: '/menus',
|
|
roles: '/roles',
|
|
organizations: '/organizations',
|
|
};
|
|
|
|
// 选择器定义
|
|
export const SELECTORS = {
|
|
login: {
|
|
accountInput: 'input[type="text"]',
|
|
passwordInput: 'input[type="password"]',
|
|
submitButton: 'button[type="submit"]',
|
|
errorMessage: '.text-red-400',
|
|
},
|
|
sidebar: {
|
|
dashboardLink: 'a[href="/dashboard"]',
|
|
usersLink: 'a[href="/users"]',
|
|
settingsLink: 'a[href="/settings"]',
|
|
logoutButton: 'button[title="退出登录"]',
|
|
},
|
|
dashboard: {
|
|
statsCards: '.grid > div',
|
|
chartContainer: '.h-64',
|
|
activityList: '.space-y-4 > div',
|
|
},
|
|
users: {
|
|
searchInput: 'input[placeholder*="搜索"]',
|
|
addButton: 'button:has-text("添加用户")',
|
|
table: 'table',
|
|
tableRows: 'tbody tr',
|
|
editButton: 'button:has(> svg[data-lucide="Edit2"])',
|
|
deleteButton: 'button:has(> svg[data-lucide="Trash2"])',
|
|
modal: {
|
|
container: '[role="dialog"]',
|
|
usernameInput: 'input[placeholder*="用户名"]',
|
|
emailInput: 'input[type="email"]',
|
|
passwordInput: 'input[type="password"]',
|
|
phoneInput: 'input[placeholder*="手机号"]',
|
|
roleSelect: 'select',
|
|
remarkInput: 'input[placeholder*="备注"]',
|
|
saveButton: 'button:has-text("保存"), button:has-text("创建")',
|
|
cancelButton: 'button:has-text("取消")',
|
|
},
|
|
},
|
|
menus: {
|
|
addButton: 'button:has-text("添加菜单")',
|
|
refreshButton: 'button:has-text("刷新")',
|
|
table: 'table',
|
|
tableRows: 'tbody tr',
|
|
},
|
|
roles: {
|
|
searchInput: 'input[placeholder*="搜索角色"]',
|
|
addButton: 'button:has-text("新建角色")',
|
|
table: 'table',
|
|
assignMenuButton: 'button:has-text("分配菜单")',
|
|
},
|
|
organizations: {
|
|
searchInput: 'input[placeholder*="搜索"]',
|
|
addButton: 'button:has-text("新增组织")',
|
|
table: 'table',
|
|
},
|
|
};
|
|
|