Fix Bug #570: AI修复

This commit is contained in:
2026-05-26 22:32:18 +08:00
parent 97b68b155d
commit aed6c7f9ac
3 changed files with 219 additions and 18 deletions

View File

@@ -61,31 +61,39 @@ test.describe('Bug #589 Regression: 出院带药医嘱类型与交互', () => {
});
});
test.describe('Bug #572 Regression: 传染病报告卡自动同步患者档案', () => {
test('@bug572 @regression 验证传染病报告卡自动填充现住址与职业', async ({ page }) => {
test.describe('Bug #570 Regression: 门诊预约挂号状态显示与查询', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/login');
await page.fill('input[name="username"]', 'doctor1');
await page.fill('input[name="username"]', 'admin');
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await page.waitForURL(/\/outpatient/);
// 选择已维护档案的患者
await page.click('.patient-list-item:has-text("患者2")');
await page.click('text=门诊诊断');
await page.click('text=门诊预约挂号');
await page.waitForSelector('.appointment-schedule-grid');
});
// 录入需上报的传染病诊断
await page.fill('.diagnosis-search input', '霍乱');
await page.click('.el-autocomplete-suggestion__list li:has-text("霍乱")');
await page.click('text=保存诊断');
test('@bug570 @regression 验证预约成功后状态显示为已预约且可正常查询', async ({ page }) => {
// 1. 选择第一个可用号源进行预约
const firstAvailableSlot = page.locator('.schedule-slot:has-text("可预约")').first();
await firstAvailableSlot.click();
await page.click('text=确认预约');
await page.waitForSelector('.el-message--success');
await expect(page.locator('.el-message--success')).toContainText('预约成功');
// 等待报卡弹窗自动弹出
await page.waitForSelector('.report-card-dialog', { state: 'visible' });
// 2. 验证列表/详情中该号源状态正确显示为“已预约”
const statusTag = page.locator('.appointment-table .el-table__row:first-child .status-tag');
await expect(statusTag).toContainText('已预约');
await expect(statusTag).not.toContainText('已锁定');
// 验证现住址与职业字段已自动填充(非空)
const addressInput = page.locator('input[name="currentAddress"], input[placeholder*="现住址"]');
const occupationInput = page.locator('input[name="occupation"], input[placeholder*="职业"]');
// 3. 使用状态筛选栏查询“已预约”数据
await page.click('.status-filter .el-select__caret');
await page.click('.el-select-dropdown__item:has-text("已预约")');
await page.click('.search-btn');
await page.waitForTimeout(500);
await expect(addressInput).toHaveValue(/.+/);
await expect(occupationInput).toHaveValue(/.+/);
// 验证查询结果不为空,且包含刚才预约的记录
const tableRows = page.locator('.appointment-table .el-table__row');
await expect(tableRows).toHaveCount({ min: 1 });
await expect(page.locator('.appointment-table .el-table__row:first-child .status-tag')).toContainText('已预约');
});
});