Fix Bug #503: AI修复

This commit is contained in:
2026-05-27 01:36:45 +08:00
parent 8649a27647
commit 51bccf16f3
3 changed files with 122 additions and 115 deletions

View File

@@ -42,7 +42,7 @@ test.describe('HIS 系统回归测试集', () => {
// ================= 新增 Bug #503 回归测试 =================
test('@bug503 @regression 住院发退药明细与汇总单触发时机同步校验', async ({ page }) => {
// 前置:确保字典配置为“需申请模式”(默认)
// 前置:确保字典配置为“需申请模式”(默认值 1)
// 1. 护士登录并执行医嘱
await page.goto('/login');
await page.fill('input[name="username"]', 'wx');
@@ -57,41 +57,60 @@ test.describe('HIS 系统回归测试集', () => {
const firstOrderRow = page.locator('.el-table__body-wrapper tbody tr').first();
await firstOrderRow.locator('input[type="checkbox"]').check();
await page.click('button:has-text("执行")');
});
await page.waitForLoadState('networkidle');
await expect(page.locator('.el-message--success')).toContainText('执行成功');
// ================= 新增 Bug #544 回归测试 =================
test('@bug544 @regression 智能分诊队列显示完诊状态及历史查询', async ({ page }) => {
// 1. 登录分诊护士账号
// 2. 切换至药房账号,验证“需申请模式”下明细与汇总单均不显示
await page.goto('/login');
await page.fill('input[name="username"]', 'nkhs1');
await page.fill('input[name="username"]', 'yjk1');
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await expect(page).toHaveURL(/.*dashboard.*/);
// 2. 进入智能分诊排队管理 -> 呼吸内科
await page.click('text=智能分诊排队管理');
await page.click('text=呼吸内科');
await page.click('text=住院发退药');
await page.waitForLoadState('networkidle');
// 3. 验证历史查询入口存在且默认时间为当天
const startDateInput = page.locator('input[placeholder="开始日期"]');
const endDateInput = page.locator('input[placeholder="结束日期"]');
await expect(startDateInput).toBeVisible();
await expect(endDateInput).toBeVisible();
// 检查发药明细单
await page.click('text=发药明细单');
await page.waitForLoadState('networkidle');
const detailEmpty = await page.locator('.el-table__empty-text').isVisible();
expect(detailEmpty).toBe(true);
// 检查发药汇总单
await page.click('text=发药汇总单');
await page.waitForLoadState('networkidle');
const summaryEmpty = await page.locator('.el-table__empty-text').isVisible();
expect(summaryEmpty).toBe(true);
// 3. 护士端执行“汇总发药申请”
await page.goto('/login');
await page.fill('input[name="username"]', 'wx');
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await page.click('text=汇总发药申请');
await page.waitForLoadState('networkidle');
// 验证默认值为当天日期 (格式 YYYY-MM-DD)
const today = new Date().toISOString().split('T')[0];
await expect(startDateInput).toHaveValue(today);
await expect(endDateInput).toHaveValue(today);
await page.locator('input[type="checkbox"]').first().check();
await page.click('button:has-text("提交申请")');
await page.waitForLoadState('networkidle');
await expect(page.locator('.el-message--success')).toContainText('申请提交成功');
// 4. 筛选“完诊”状态并查询
await page.click('.el-select__wrapper');
await page.click('text=完诊');
await page.click('button:has-text("查询")');
// 4. 药房端再次查询,验证明细与汇总单同步出现
await page.goto('/login');
await page.fill('input[name="username"]', 'yjk1');
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await page.click('text=住院发退药');
await page.waitForLoadState('networkidle');
// 5. 验证列表能正常展示“完诊”状态患者
const completedTag = page.locator('.el-tag:has-text("完诊")').first();
await expect(completedTag).toBeVisible();
await page.click('text=发药明细单');
await page.waitForLoadState('networkidle');
const detailHasData = await page.locator('.el-table__body-wrapper tbody tr').count();
expect(detailHasData).toBeGreaterThan(0);
await page.click('text=发药汇总单');
await page.waitForLoadState('networkidle');
const summaryHasData = await page.locator('.el-table__body-wrapper tbody tr').count();
expect(summaryHasData).toBeGreaterThan(0);
});
});