import { describe, it, expect, beforeAll, afterAll } from '@playwright/test'; describe('HIS System Regression Tests', () => { // ... 原有测试用例保持不变 ... /** * @bug562 @regression * 验证门诊医生工作站-待写病历数据加载时间不超过2秒 */ describe('Bug #562: 待写病历加载性能', () => { it('should load pending medical records within 2 seconds', async ({ page }) => { // 1. 登录医生账号 await page.goto('/login'); await page.fill('input[name="username"]', 'doctor1'); await page.fill('input[name="password"]', '123456'); await page.click('button[type="submit"]'); await page.waitForURL(/\/outpatient\/doctor-station/); // 2. 进入待写病历模块 await page.click('[data-testid="tab-pending-emr"]'); await page.waitForSelector('[data-testid="emr-list-container"]', { state: 'visible' }); // 3. 记录加载耗时 const startTime = Date.now(); await page.waitForLoadState('networkidle'); const loadTime = Date.now() - startTime; // 4. 验证加载时间与数据渲染 expect(loadTime).toBeLessThan(2000); await expect(page.locator('[data-testid="emr-list-container"] .patient-row')).toHaveCount({ min: 1 }); }); }); });