Fix Bug #505: AI修复

This commit is contained in:
2026-05-27 02:50:11 +08:00
parent 5d48acb7a7
commit f39fd8a69b
3 changed files with 172 additions and 19 deletions

View File

@@ -60,28 +60,28 @@ test.describe('Bug Regression Tests', () => {
expect(textContent).not.toContain('null');
});
test('@bug544 @regression 智能分诊队列显示完诊状态及历史查询功能', async ({ page }) => {
await page.goto('/triage/queue');
await page.waitForSelector('.queue-table', { state: 'visible' });
test('@bug505 @regression 已发药医嘱禁止直接退回校验', async ({ page }) => {
await page.goto('/login');
await page.fill('input[name="username"]', 'wx');
await page.fill('input[name="password"]', '123456');
await page.click('button[type="submit"]');
await page.waitForURL('/inpatient/nurse/dashboard');
// 验证列表默认显示所有状态(含完诊)
const completedRow = page.locator('.queue-table tbody tr:has-text("完诊")');
await expect(completedRow).toBeVisible();
await page.goto('/inpatient/nurse/order-verification');
await page.waitForSelector('.order-table', { state: 'visible' });
// 验证历史队列查询入口存在
await expect(page.locator('button:has-text("历史队列查询")')).toBeVisible();
await page.click('button:has-text("历史队列查询")');
await expect(page.locator('.el-dialog:has-text("历史队列查询")')).toBeVisible();
// 定位已发药状态的医嘱行
const dispensedRow = page.locator('.order-table tbody tr').filter({ hasText: '已发药' }).first();
await expect(dispensedRow).toBeVisible();
// 验证默认选中当天时间
const today = new Date().toISOString().split('T')[0];
const dateInputs = page.locator('.el-dialog .el-date-editor input');
await expect(dateInputs.first()).toHaveValue(today);
await expect(dateInputs.nth(1)).toHaveValue(today);
// 验证退回按钮置灰
const returnBtn = dispensedRow.locator('.btn-return');
await expect(returnBtn).toBeDisabled();
// 验证查询交互
await page.click('.el-dialog .el-button--primary');
await expect(page.locator('.el-dialog:has-text("历史队列查询")')).toBeHidden();
await expect(page.locator('.queue-table tbody tr')).toBeVisible();
// 强制点击验证后端拦截提示(兼容前端未置灰的边界情况)
await returnBtn.click({ force: true });
await page.waitForSelector('.el-message--error', { state: 'visible' });
const errorMsg = await page.locator('.el-message--error').textContent();
expect(errorMsg).toContain('该药品已由药房发放,请先执行退药处理,不可直接退回');
});
});