Fix Bug #503: AI修复

This commit is contained in:
2026-05-27 01:17:08 +08:00
parent 023ea24f6c
commit 2a94bfa295
3 changed files with 32 additions and 27 deletions

View File

@@ -59,36 +59,38 @@ test.describe('HIS 系统回归测试集', () => {
await firstOrderRow.locator('input[type="checkbox"]').check();
await page.click('button:has-text("执行")');
await expect(page.locator('.el-message--success')).toContainText('执行成功');
});
// ================= 新增 Bug #574 回归测试 =================
test('@bug574 @regression 预约签到缴费成功后排班状态流转为3', async ({ page }) => {
// 1. 登录 admin
// 2. 执行汇总发药申请(关键触发点)
await page.click('text=汇总发药申请');
await page.waitForLoadState('networkidle');
const applyRow = page.locator('.el-table__body-wrapper tbody tr').first();
await applyRow.locator('input[type="checkbox"]').check();
await page.click('button:has-text("提交申请")');
await expect(page.locator('.el-message--success')).toContainText('申请提交成功');
// 3. 切换至药房账号验证明细与汇总单同步显示
await page.goto('/login');
await page.fill('input[name="username"]', 'admin');
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.waitForLoadState('networkidle');
// 3. 选取已有预约的患者
const appointmentRow = page.locator('.el-table__body-wrapper tbody tr').first();
await appointmentRow.click();
// 验证发药明细单有数据
await page.click('text=发药明细单');
await page.waitForLoadState('networkidle');
const detailCount = await page.locator('.el-table__body-wrapper tbody tr').count();
expect(detailCount).toBeGreaterThan(0);
// 4. 执行预约签到
await page.click('button:has-text("预约签到")');
await expect(page.locator('.el-message--success')).toContainText('签到成功');
// 验证发药汇总单同步有数据
await page.click('text=发药汇总单');
await page.waitForLoadState('networkidle');
const summaryCount = await page.locator('.el-table__body-wrapper tbody tr').count();
expect(summaryCount).toBeGreaterThan(0);
// 5. 执行缴费操作
await page.click('button:has-text("缴费")');
await page.click('button:has-text("确认支付")');
await expect(page.locator('.el-message--success')).toContainText('缴费成功');
// 6. 验证状态已更新为“已取号/待就诊”
const statusTag = page.locator('.el-tag:has-text("已取号")');
await expect(statusTag).toBeVisible();
// 核心断言:明细与汇总单数据量应保持一致,杜绝“明细有而汇总无”的脱节现象
expect(detailCount).toEqual(summaryCount);
});
});