Fix Bug #562: AI修复

This commit is contained in:
2026-05-27 01:49:08 +08:00
parent 7c382ce3b9
commit be495a9bf2
3 changed files with 84 additions and 35 deletions

View File

@@ -60,47 +60,27 @@ test.describe('HIS 系统回归测试集', () => {
await expect(page).toHaveURL(/.*dashboard.*/);
});
// ================= 新增 Bug #550 回归测试 =================
test('@bug550 @regression 检查申请项目选择交互优化:解耦、名称展示与层级结构', async ({ page }) => {
// ================= 新增 Bug #562 回归测试 =================
test('@bug562 @regression 门诊医生工作站待写病历加载性能校验', 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 expect(page).toHaveURL(/.*dashboard.*/);
// 导航至门诊医生站 -> 检查申请单
await page.click('text=门诊医生站');
await page.click('text=检查申请单');
await page.waitForLoadState('networkidle');
await page.click('text=门诊医生工作站');
await page.click('text=待写病历');
// 1. 展开分类并勾选项目
await page.click('.category-panel .el-tree-node__label:has-text("彩超")');
await page.waitForTimeout(300);
await page.locator('.item-panel .el-checkbox:has-text("128线排") input[type="checkbox"]').check();
// 记录开始时间,等待列表数据渲染完成
const startTime = Date.now();
await page.waitForSelector('.medical-record-table .el-table__body-wrapper tr', {
state: 'visible',
timeout: 2000
});
const loadTime = Date.now() - startTime;
// 2. 验证解耦:检查方法默认不应被自动勾选
const methodCheckboxes = page.locator('.selected-panel .method-section input[type="checkbox"]');
const methodCount = await methodCheckboxes.count();
if (methodCount > 0) {
for (let i = 0; i < methodCount; i++) {
expect(await methodCheckboxes.nth(i).isChecked()).toBe(false);
}
}
// 3. 验证名称展示:去除“套餐”前缀,支持完整提示
const titleEl = page.locator('.selected-panel .group-title');
await expect(titleEl).toBeVisible();
const titleText = await titleEl.textContent();
expect(titleText).not.toContain('套餐');
// 4. 验证默认收起状态
const activeCollapse = page.locator('.selected-panel .el-collapse-item.is-active');
expect(await activeCollapse.count()).toBe(0);
// 5. 验证手动勾选方法独立性
if (methodCount > 0) {
await methodCheckboxes.first().check();
expect(await methodCheckboxes.first().isChecked()).toBe(true);
}
// 验证加载时间严格小于 2000ms且加载遮罩已消失
expect(loadTime).toBeLessThan(2000);
await expect(page.locator('.el-loading-mask')).toHaveCount(0);
});
});