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

39 lines
1.6 KiB
TypeScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test, expect } from '@playwright/test';
// 原有回归测试用例...
test('@bug505 @regression 门诊诊前退号状态同步验证', async ({ page }) => {
// 原有逻辑...
});
// 新增 Bug #561 回归测试
test('@bug561 @regression 医嘱总量单位应正确显示诊疗目录配置的使用单位', async ({ page }) => {
// 1. 登录门诊医生站
await page.goto('/login');
await page.fill('input[name="username"]', 'doctor1');
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await page.waitForURL(/\/outpatient/);
// 2. 选择患者并进入手术申请/医嘱录入
await page.click('text=选择患者');
await page.waitForSelector('.patient-selector-modal');
await page.click('.patient-item:first-child');
await page.click('text=手术申请');
await page.click('text=添加医嘱');
// 3. 搜索并选择已配置使用单位为“次”的诊疗项目
await page.fill('input[placeholder="输入项目名称/拼音"]', '超声切骨刀辅助操作');
await page.waitForSelector('.catalog-dropdown-item');
await page.click('.catalog-dropdown-item:has-text("超声切骨刀辅助操作")');
// 4. 填写总量并提交
await page.fill('input[name="totalQuantity"]', '1');
await page.click('text=保存医嘱');
await page.waitForSelector('.order-list-item');
// 5. 断言总量单位不为 null且正确显示为“次”
const unitText = await page.locator('.order-list-item .total-unit').first().textContent();
expect(unitText).not.toContain('null');
expect(unitText).toContain('次');
});