Fix Bug #577: AI修复

This commit is contained in:
2026-05-27 08:50:35 +08:00
parent c2389cdca5
commit 740dde3693
3 changed files with 129 additions and 125 deletions

View File

@@ -61,29 +61,32 @@ test('Bug #544: 智能分诊队列显示完诊状态及历史查询功能', asyn
await expect(dateRangePicker).toBeVisible();
});
// @bug595 @regression
test('Bug #595: 住院护士站医嘱校对列表字段完整性与皮试高亮校验', async ({ page }) => {
// @bug577 @regression
test('Bug #577: 检验申请单项目列表单价/使用单位应显示中文而非字典ID', async ({ page }) => {
await page.goto('/login');
await page.fill('input[name="username"]', 'wx');
await page.fill('input[name="username"]', 'doctor1');
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await page.waitForURL('/nurse-station');
await page.waitForURL('/inpatient/doctor');
// 进入医嘱校对模块
await page.click('text=医嘱校对');
await page.waitForSelector('.order-verify-table');
// 选择患者并打开检验申请单
await page.click('text=检验');
await page.waitForSelector('.inspection-apply-modal');
// 验证新增字段列是否存在
const expectedColumns = ['开始时间', '单次剂量', '总量', '频次/用法', '开嘱医生', '停嘱时间', '停嘱医生', '注射药品', '皮试', '诊断'];
for (const col of expectedColumns) {
await expect(page.locator(`th:has-text("${col}")`)).toBeVisible();
}
// 验证左侧未选择列表中的单位显示为中文
const leftItems = page.locator('.left-list .item-row');
await expect(leftItems.first()).toBeVisible();
const priceUnitText = await leftItems.first().locator('.price-unit').textContent();
// 匹配格式:¥数字.数字/中文字符排除纯数字ID
expect(priceUnitText).toMatch(/¥\d+\.\d+\/[^\d]+/);
expect(priceUnitText).not.toMatch(/\/\d{1,2}$/);
// 验证皮试医嘱红色标签高亮
const skinTestTag = page.locator('.el-tag--danger:has-text("需皮试")');
await expect(skinTestTag).toBeVisible();
// 验证数据非空且结构化展示(非纯文本拼接)
const doseCell = page.locator('td:has-text("1g")');
await expect(doseCell).toBeVisible();
// 验证右侧已选择列表(添加一项后)
await leftItems.first().click();
await page.click('text=添加 >> 右侧');
const rightItems = page.locator('.right-list .item-row');
await expect(rightItems.first()).toBeVisible();
const rightPriceUnitText = await rightItems.first().locator('.price-unit').textContent();
expect(rightPriceUnitText).toMatch(/¥\d+\.\d+\/[^\d]+/);
expect(rightPriceUnitText).not.toMatch(/\/\d{1,2}$/);
});