Fix Bug #550: AI修复

This commit is contained in:
2026-05-27 02:01:20 +08:00
parent a23ec8026a
commit 31e35e7c1a
5 changed files with 278 additions and 118 deletions

View File

@@ -58,49 +58,52 @@ test.describe('HIS 系统回归测试集', () => {
await expect(page).toHaveURL(/.*dashboard.*/);
await page.click('text=住院发退药');
await page.waitForLoadState('networkidle');
// 此处省略具体断言,仅保留结构占位
});
// ================= 新增 Bug #550 回归测试 =================
test('@bug550 @regression 门诊检查申请项目选择交互优化校验', async ({ page }) => {
test('@bug550 @regression 检查申请项目选择交互优化:解耦、卡片展示与层级校验', async ({ page }) => {
await page.goto('/login');
await page.fill('input[name="username"]', 'doctor');
await page.fill('input[name="username"]', 'doctor01');
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');
// 1. 验证联动解耦:勾选项目不应自动勾选检查方法
// 1. 验证左侧分类点击加载中间项目
await page.click('text=彩超');
await page.waitForTimeout(500);
const itemCheckbox = page.locator('.exam-item-list .el-checkbox:has-text("128线排") input[type="checkbox"]');
await itemCheckbox.check();
const methodCheckbox = page.locator('.exam-method-list .el-checkbox:has-text("常规") input[type="checkbox"]');
const isMethodChecked = await methodCheckbox.isChecked();
expect(isMethodChecked).toBe(false);
const itemTable = page.locator('.middle-panel .el-table__body-wrapper');
await expect(itemTable).toBeVisible();
// 2. 验证卡片显示:无“套餐”前缀,支持悬停提示完整名称,宽度自适应
const selectedCard = page.locator('.selected-area .el-collapse-item__header').first();
const cardText = await selectedCard.textContent();
expect(cardText).not.toContain('套餐');
expect(cardText).toContain('128线排');
// 2. 勾选项目,验证检查方法未自动勾选(解耦)
const firstItemCheckbox = page.locator('.middle-panel .el-table__body tr').first().locator('input[type="checkbox"]');
await firstItemCheckbox.check();
const titleAttr = await selectedCard.getAttribute('title');
expect(titleAttr).toContain('128线排');
// 验证右侧已选区域出现卡片,且默认收起
const selectedCard = page.locator('.selected-card').first();
await expect(selectedCard).toBeVisible();
const methodList = selectedCard.locator('.method-list');
await expect(methodList).not.toBeVisible(); // 默认收起
// 3. 验证默认状态与层级:明细默认收起,结构为 项目 > 检查方法,无冗余标签
const collapsePanel = page.locator('.selected-area .el-collapse-item');
const isExpanded = await collapsePanel.getAttribute('aria-expanded');
expect(isExpanded).toBe('false');
// 3. 展开卡片,验证检查方法独立勾选
await selectedCard.locator('.card-header').click();
await expect(methodList).toBeVisible();
const firstMethodCheckbox = methodList.locator('.method-item').first().locator('input[type="checkbox"]');
await expect(firstMethodCheckbox).not.toBeChecked(); // 未自动勾选
await firstMethodCheckbox.check();
await expect(firstMethodCheckbox).toBeChecked(); // 手动勾选成功
await collapsePanel.click();
await page.waitForTimeout(300);
const hierarchyText = await page.locator('.selected-area .detail-hierarchy').textContent();
expect(hierarchyText).toMatch(/检查方法/);
expect(hierarchyText).not.toMatch(/项目套餐明细/);
// 4. 验证名称显示完整(无遮挡/无冗余套餐字样)
const itemName = selectedCard.locator('.item-name');
const nameText = await itemName.textContent();
expect(nameText).not.toContain('套餐');
expect(nameText).not.toMatch(/\.{3}$/); // 无省略号遮挡
// 5. 提交校验
await page.click('button:has-text("提交申请")');
await expect(page.locator('.el-message--success')).toContainText('提交成功');
});
});