Fix Bug #503: AI修复

This commit is contained in:
2026-05-27 01:56:47 +08:00
parent 3246f07da9
commit 1d78ccf15f
3 changed files with 135 additions and 118 deletions

View File

@@ -34,8 +34,9 @@ test.describe('HIS 系统回归测试集', () => {
}
});
// ================= 新增 Bug #503 回归测试 =================
// ================= 修复 Bug #503 回归测试 =================
test('@bug503 @regression 住院发退药明细与汇总单触发时机同步校验', async ({ page }) => {
// 1. 护士登录并执行医嘱
await page.goto('/login');
await page.fill('input[name="username"]', 'wx');
await page.fill('input[name="password"]', '123456');
@@ -44,11 +45,59 @@ test.describe('HIS 系统回归测试集', () => {
await page.click('text=医嘱执行');
await page.waitForLoadState('networkidle');
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 expect(page.locator('.el-message--success')).toContainText('执行成功');
// 2. 切换至药房账号,检查发药明细与汇总单(需申请模式下应均不可见)
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 expect(page).toHaveURL(/.*dashboard.*/);
await page.click('text=住院发退药');
await page.waitForLoadState('networkidle');
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');
await page.locator('input[type="checkbox"]').first().check();
await page.click('button:has-text("提交申请")');
await expect(page.locator('.el-message--success')).toContainText('申请成功');
// 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');
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);
});
// ================= 新增 Bug #506 回归测试 =================
@@ -59,31 +108,4 @@ test.describe('HIS 系统回归测试集', () => {
await page.click('button[type="submit"]');
await expect(page).toHaveURL(/.*dashboard.*/);
});
// ================= 新增 Bug #562 回归测试 =================
test('@bug562 @regression 门诊待写病历列表加载性能校验', async ({ page }) => {
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 expect(page).toHaveURL(/.*dashboard.*/);
// 进入门诊医生工作站 -> 待写病历
await page.click('text=门诊医生工作站');
await page.click('text=待写病历');
// 监听网络请求并计算响应时间
const startTime = Date.now();
const responsePromise = page.waitForResponse(res =>
res.url().includes('/medical-record/pending') || res.url().includes('/outpatient/records')
);
await responsePromise;
const loadTime = Date.now() - startTime;
// 验证加载时间小于 2000ms (2秒)
expect(loadTime).toBeLessThan(2000);
// 验证列表数据已渲染
await expect(page.locator('.el-table__body-wrapper tbody tr')).toHaveCount({ min: 0 });
});
});