import { test, expect } from '@playwright/test' import { uiLogin } from '../utils/auth' test.describe('通知铃铛', () => { test('铃铛显示未读数且下拉展开', async ({ page }) => { await uiLogin(page) await page.goto('/dashboard') const bell = page.locator('.ant-badge') await expect(bell.first()).toBeVisible() await bell.first().click() await page.waitForTimeout(1000) const menu = page.locator('.ant-dropdown') if (await menu.count() > 0) { await expect(menu.first()).toBeVisible() } }) test('通知下拉包含通知标题或空提示', async ({ page }) => { await uiLogin(page) await page.goto('/dashboard') await page.locator('.ant-badge').first().click() await page.waitForTimeout(1000) const hasTitle = await page.getByText('通知').count() const hasEmpty = await page.getByText('暂无通知').count() expect(hasTitle + hasEmpty).toBeGreaterThan(0) }) })