Fix Bug #550: AI修复

This commit is contained in:
2026-05-27 01:06:25 +08:00
parent d803e69f62
commit 92516d2e19
2 changed files with 136 additions and 67 deletions

View File

@@ -61,37 +61,44 @@ test.describe('HIS 系统回归测试集', () => {
});
// ================= 新增 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="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.click('.exam-item-checkbox:has-text("128线排")');
const methodCheckbox = page.locator('.method-checkbox').first();
await expect(methodCheckbox).not.toBeChecked();
const itemCheckbox = page.locator('.exam-item-checkbox').filter({ hasText: '128线排' }).locator('input[type="checkbox"]');
await itemCheckbox.check();
// 2. 验证卡片显示名称截断与Tooltip提示无冗余“套餐”字样
// 2. 验证联动冲突已解耦:检查方法不应被自动勾选
const methodCheckboxes = page.locator('.method-checkbox input[type="checkbox"]');
const methodCount = await methodCheckboxes.count();
if (methodCount > 0) {
const firstMethodChecked = await methodCheckboxes.first().isChecked();
expect(firstMethodChecked).toBe(false); // 默认不自动勾选,保持独立
}
// 3. 验证卡片默认收起且无冗余“套餐”文案
const selectedCard = page.locator('.selected-card').first();
await expect(selectedCard.locator('.item-name')).toHaveText(/128线排/);
await expect(selectedCard.locator('.item-name')).not.toContainText('套餐');
// 悬停验证Tooltip完整名称
await selectedCard.locator('.item-name').hover();
await expect(page.locator('.el-tooltip__popper')).toBeVisible();
await expect(selectedCard.locator('.card-details')).toBeHidden(); // 默认收起
await expect(selectedCard.locator('.item-name')).not.toContainText('套餐'); // 清理前缀
// 3. 验证结构化展示与折叠交互:默认收起,点击展开/收起
await expect(page.locator('.card-details')).not.toBeVisible();
// 4. 验证展开/收起交互与层级结构
await selectedCard.locator('.card-header').click();
await expect(page.locator('.card-details')).toBeVisible();
await selectedCard.locator('.card-header').click();
await expect(page.locator('.card-details')).not.toBeVisible();
await expect(selectedCard.locator('.card-details')).toBeVisible();
// 5. 验证方法独立勾选
if (methodCount > 0) {
await methodCheckboxes.first().check();
const isChecked = await methodCheckboxes.first().isChecked();
expect(isChecked).toBe(true);
}
});
});