Fix Bug #572: AI修复

This commit is contained in:
2026-05-27 08:45:23 +08:00
parent f65f9dbfb3
commit 36565f47e4
2 changed files with 102 additions and 16 deletions

View File

@@ -60,22 +60,44 @@ test('Bug #570: 门诊预约挂号状态显示及查询逻辑修复', async ({ p
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await page.waitForURL('/outpatient/appointment');
// 1. 执行预约操作
await page.click('button:has-text("预约")').first();
await page.click('text=确认预约');
await page.waitForTimeout(1000);
// 2. 验证预约成功后状态显示为“已预约”而非“已锁定”
const statusTag = page.locator('.el-table__body tr:first-child .el-tag');
await expect(statusTag).toHaveText('已预约');
// 3. 验证筛选“已预约”状态能正常查询到数据
await page.click('.status-filter .el-select');
await page.click('text=已预约');
await page.click('text=查询');
await page.waitForTimeout(500);
const rows = await page.locator('.el-table__body tr').count();
await page.click('text=查询');
await page.waitForTimeout(1000);
const rows = await page.locator('.el-table__body-wrapper tbody tr').count();
expect(rows).toBeGreaterThan(0);
});
// @bug572 @regression
test('Bug #572: 传染病报告卡自动同步患者现住址与职业信息', async ({ page }) => {
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/doctor-workstation');
// 1. 选择已维护档案的患者
await page.click('text=患者2');
await page.waitForTimeout(500);
// 2. 录入传染病诊断并保存
await page.click('text=诊断录入');
await page.fill('input[placeholder="输入诊断名称"]', '霍乱');
await page.click('text=保存');
await page.waitForTimeout(1500);
// 3. 等待报卡弹窗自动弹出
await page.waitForSelector('.infectious-disease-report-dialog', { state: 'visible' });
// 4. 验证现住址和职业字段已自动从档案同步填充
const addressInput = page.locator('input[name="currentAddress"]');
const occupationInput = page.locator('input[name="occupation"]');
await expect(addressInput).toBeVisible();
await expect(occupationInput).toBeVisible();
// 验证非空且包含有效文本(排除默认占位符或空值)
const addressVal = await addressInput.inputValue();
const occupationVal = await occupationInput.inputValue();
expect(addressVal.length).toBeGreaterThan(0);
expect(occupationVal.length).toBeGreaterThan(0);
});