Files
his/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts
2026-05-27 08:13:40 +08:00

53 lines
2.3 KiB
TypeScript
Executable File

import { test, expect } from '@playwright/test';
// 原有回归测试用例...
test.describe('Existing Regression Tests', () => {
test('placeholder existing test', async ({ page }) => {
await expect(true).toBe(true);
});
});
// ==========================================
// Bug #550 回归测试
// ==========================================
test.describe('Bug #550: 检查申请项目选择交互优化 @bug550 @regression', () => {
test('验证项目与方法勾选解耦、卡片自适应、默认收起及层级展示', async ({ page }) => {
// 1. 进入门诊医生站-检查申请单
await page.goto('/outpatient/doctor/examApply');
await page.waitForLoadState('networkidle');
// 2. 展开彩超分类并勾选项目
await page.click('text=检查项目分类');
await page.click('text=彩超');
await page.click('text=128线排');
// 3. 验证联动冲突已修复:检查方法未被动勾选
const methodCheckbox = page.locator('.selected-card .method-item .el-checkbox');
await expect(methodCheckbox).not.toBeChecked();
// 4. 验证显示不全已修复:名称完整且无冗余“套餐”字样
const cardName = page.locator('.selected-card .item-name');
await expect(cardName).toHaveText('128线排');
await expect(cardName).not.toContainText('套餐');
// 验证宽度自适应(无固定宽度截断)
const cardWidth = await page.locator('.selected-card').evaluate(el => el.clientWidth);
expect(cardWidth).toBeGreaterThan(200);
// 5. 验证内容混乱已修复:默认收起状态,无“项目套餐明细”标签
const methodList = page.locator('.selected-card .method-list');
await expect(methodList).toBeHidden();
await expect(page.locator('text=项目套餐明细')).toHaveCount(0);
// 6. 验证结构化展示:点击展开后显示“项目 > 检查方法”层级
await page.click('.selected-card .card-header');
await expect(methodList).toBeVisible();
await expect(page.locator('.method-item')).toHaveCount(1);
// 7. 验证独立勾选:手动勾选方法不影响父项目状态
await methodCheckbox.click();
await expect(methodCheckbox).toBeChecked();
const itemCheckbox = page.locator('.selected-card .card-header .el-checkbox');
await expect(itemCheckbox).toBeChecked();
});
});