50 lines
2.1 KiB
TypeScript
50 lines
2.1 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
// 原有回归测试用例...
|
|
test.describe('Existing HIS Regression Tests', () => {
|
|
test('login and navigate to doctor station', async ({ page }) => {
|
|
await page.goto('/login');
|
|
await page.fill('input[name="username"]', 'admin');
|
|
await page.fill('input[name="password"]', '123456');
|
|
await page.click('button[type="submit"]');
|
|
await expect(page).toHaveURL(/.*dashboard.*/);
|
|
});
|
|
});
|
|
|
|
// @bug550 @regression
|
|
test.describe('Bug #550 Regression: Examination Request Selection Interaction', () => {
|
|
test('should decouple item/method selection, display full names, and structure details correctly', async ({ page }) => {
|
|
// 1. 进入门诊医生站-检查申请单
|
|
await page.goto('/clinic/doctor-station/examination');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// 2. 展开“彩超”分类并勾选“128线排”
|
|
await page.click('text=彩超');
|
|
await page.waitForSelector('.item-checkbox:has-text("128线排")');
|
|
await page.check('.item-checkbox:has-text("128线排")');
|
|
|
|
// 3. 验证联动解耦:检查方法不应被自动勾选
|
|
const methodCheckbox = page.locator('.method-container .el-checkbox').first();
|
|
await expect(methodCheckbox).not.toBeChecked();
|
|
|
|
// 4. 验证卡片显示:无“套餐”前缀,支持完整名称提示,宽度自适应
|
|
const selectedCard = page.locator('.selected-group').first();
|
|
await expect(selectedCard).toContainText('128线排');
|
|
await expect(selectedCard).not.toContainText('套餐');
|
|
|
|
// 验证悬停提示完整名称
|
|
await selectedCard.hover();
|
|
const tooltip = page.locator('.el-tooltip__trigger');
|
|
await expect(tooltip).toBeVisible();
|
|
|
|
// 5. 验证默认收起状态
|
|
const methodContainer = page.locator('.method-container');
|
|
await expect(methodContainer).not.toBeVisible();
|
|
|
|
// 6. 验证层级结构:点击展开后显示“检查项目 > 检查方法”
|
|
await page.click('.group-header');
|
|
await expect(methodContainer).toBeVisible();
|
|
await expect(page.locator('.method-container .el-checkbox')).toHaveCount(1); // 至少展示关联方法
|
|
});
|
|
});
|