AdmSysV2【公共组件库】@前端(For Git Submodule)
Tevin
2 days ago 9f6212d61eba53eb4da504876f5a01b93a80fc1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { test, expect } from '@playwright/test';
 
test.describe('CSideMenu 组件', () => {
  test.beforeEach(async ({ page }) => {
    await page.goto('http://localhost:5173/#/preview/pages/side-menu/SideMenuPage.tsx');
  });
 
  test('页面加载正常', async ({ page }) => {
    // 等待页面加载
    await page.waitForSelector('text=CSideMenu 组件示例', { timeout: 10000 });
    // 验证标题
    await expect(page.locator('text=CSideMenu 组件示例')).toBeVisible();
  });
 
  test('左侧菜单显示正常', async ({ page }) => {
    // 验证菜单标题
    await expect(page.locator('text=管理后台')).toBeVisible();
    // 验证菜单项
    await expect(page.locator('text=导航1')).toBeVisible();
  });
 
  test('菜单点击功能正常', async ({ page }) => {
    // 点击子菜单
    await page.click('text=子菜单1-1');
    // 验证页面1-1-1 显示
    await expect(page.locator('text=页面1-1-1')).toBeVisible();
  });
});