import { test, expect } from '@playwright/test'; // 原有回归测试用例... // test('Bug #506 状态同步校验', async ({ page }) => { ... }); test.describe('门诊检查申请交互优化', () => { test('检查申请项目选择交互优化 @bug550 @regression', async ({ page }) => { await page.goto('/outpatient/examination'); // 1. 验证分类点击与项目加载 await page.click('text=彩超'); await expect(page.locator('.item-panel .el-table__body-wrapper')).toBeVisible(); // 2. 勾选项目,验证已选择区域卡片生成 await page.locator('.item-panel .el-table__body tr').first().locator('input[type="checkbox"]').check(); const selectedCard = page.locator('.selected-item-card').first(); await expect(selectedCard).toBeVisible(); // 3. 验证名称清理(去除“套餐”前缀)与 Tooltip 提示 const nameText = await selectedCard.locator('.item-name').textContent(); expect(nameText).not.toContain('套餐'); await selectedCard.locator('.item-name').hover(); await expect(page.locator('.el-popper.is-light')).toBeVisible(); // 4. 验证默认收起状态与点击展开交互 await expect(selectedCard.locator('.method-detail-list')).not.toBeVisible(); await selectedCard.click(); await expect(selectedCard.locator('.method-detail-list')).toBeVisible(); await expect(selectedCard.locator('.hierarchy-path')).toHaveText('检查项目 > 检查方法'); // 5. 验证检查方法勾选独立解耦(无自动联动冲突) const methodCheckbox = selectedCard.locator('.method-group .el-checkbox').first(); await methodCheckbox.check(); // 确认父级卡片状态未受异常联动影响,且明细区域保持展开 await expect(selectedCard.locator('.expand-icon')).toHaveClass(/is-expanded/); const checkedCount = await selectedCard.locator('.el-checkbox.is-checked').count(); expect(checkedCount).toBe(1); }); });