Fix Bug #562: AI修复

This commit is contained in:
2026-05-26 22:47:00 +08:00
parent aed6c7f9ac
commit 6d9fda0000
4 changed files with 217 additions and 27 deletions

View File

@@ -61,39 +61,29 @@ test.describe('Bug #589 Regression: 出院带药医嘱类型与交互', () => {
});
});
test.describe('Bug #570 Regression: 门诊预约挂号状态显示与查询', () => {
test.describe('Bug #562 Regression: 待写病历加载性能', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/login');
await page.fill('input[name="username"]', 'admin');
await page.fill('input[name="username"]', 'doctor1');
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await page.waitForURL(/\/outpatient/);
await page.click('text=门诊预约挂号');
await page.waitForSelector('.appointment-schedule-grid');
await page.click('text=门诊医生工作站');
await page.click('text=待写病历');
});
test('@bug570 @regression 验证预约成功后状态显示为已预约且可正常查询', async ({ page }) => {
// 1. 选择第一个可用号源进行预约
const firstAvailableSlot = page.locator('.schedule-slot:has-text("可预约")').first();
await firstAvailableSlot.click();
await page.click('text=确认预约');
await page.waitForSelector('.el-message--success');
await expect(page.locator('.el-message--success')).toContainText('预约成功');
// 2. 验证列表/详情中该号源状态正确显示为“已预约”
const statusTag = page.locator('.appointment-table .el-table__row:first-child .status-tag');
await expect(statusTag).toContainText('已预约');
await expect(statusTag).not.toContainText('已锁定');
// 3. 使用状态筛选栏查询“已预约”数据
await page.click('.status-filter .el-select__caret');
await page.click('.el-select-dropdown__item:has-text("已预约")');
await page.click('.search-btn');
await page.waitForTimeout(500);
// 验证查询结果不为空,且包含刚才预约的记录
const tableRows = page.locator('.appointment-table .el-table__row');
await expect(tableRows).toHaveCount({ min: 1 });
await expect(page.locator('.appointment-table .el-table__row:first-child .status-tag')).toContainText('已预约');
test('@bug562 @regression 验证待写病历列表加载时间小于2秒', async ({ page }) => {
const startTime = Date.now();
// 等待表格容器可见
await page.waitForSelector('.medical-record-table', { state: 'visible' });
// 等待加载遮罩消失,表示数据请求与渲染完成
await page.waitForSelector('.el-loading-mask', { state: 'hidden' });
const loadTime = Date.now() - startTime;
expect(loadTime).toBeLessThan(2000);
// 验证表格数据已渲染或显示空状态
const hasRows = await page.locator('.medical-record-table tbody tr').count();
const hasEmpty = await page.locator('.el-table__empty-text').isVisible();
expect(hasRows > 0 || hasEmpty).toBe(true);
});
});