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('次'); });