新增e2e测试脚本,修复部分问题

This commit was merged in pull request #51.
This commit is contained in:
2026-07-22 20:00:13 +08:00
parent 53d1ce6fb2
commit 4c07ec5455
105 changed files with 21700 additions and 318 deletions
+48
View File
@@ -124,6 +124,54 @@ export class DashboardPage {
await this.page.waitForLoadState('networkidle');
}
// ============================================
// Gym 业务模块导航方法
// ============================================
async navigateToMemberManagement() {
const memberMenu = this.page.locator('.el-sub-menu__title:has-text("会员管理")');
await memberMenu.click();
await this.page.waitForTimeout(1000);
const memberMenuItem = this.page.locator('.el-menu-item:has-text("会员管理")');
await memberMenuItem.click();
await this.page.waitForURL('**/members', { timeout: 30000 });
await this.page.waitForLoadState('networkidle');
}
async navigateToGroupCourseManagement() {
const courseMenu = this.page.locator('.el-sub-menu__title:has-text("团课管理")');
await courseMenu.click();
await this.page.waitForTimeout(1000);
const courseMenuItem = this.page.locator('.el-menu-item:has-text("团课管理")');
await courseMenuItem.click();
await this.page.waitForURL('**/group-courses', { timeout: 30000 });
await this.page.waitForLoadState('networkidle');
}
async navigateToCoachManagement() {
const coachMenuItem = this.page.locator('.el-menu-item:has-text("教练管理")');
await coachMenuItem.click();
await this.page.waitForURL('**/coaches', { timeout: 30000 });
await this.page.waitForLoadState('networkidle');
}
async navigateToCheckInManagement() {
const checkInMenuItem = this.page.locator('.el-menu-item:has-text("签到管理")');
await checkInMenuItem.click();
await this.page.waitForURL('**/checkin', { timeout: 30000 });
await this.page.waitForLoadState('networkidle');
}
async navigateToStatisticsDashboard() {
const statsMenu = this.page.locator('.el-sub-menu__title:has-text("数据统计")');
await statsMenu.click();
await this.page.waitForTimeout(1000);
const statsMenuItem = this.page.locator('.el-menu-item:has-text("数据统计看板")');
await statsMenuItem.click();
await this.page.waitForURL('**/statistics', { timeout: 30000 });
await this.page.waitForLoadState('networkidle');
}
async getUsername(): Promise<string | null> {
return await this.userInfo.textContent();
}