73 lines
2.9 KiB
TypeScript
Executable File
73 lines
2.9 KiB
TypeScript
Executable File
import { test, expect } from '@playwright/test';
|
||
|
||
/**
|
||
* @bug505 @regression
|
||
* 验证 Bug #505:已发药医嘱不可直接退回
|
||
*/
|
||
test.describe('Bug #505 Regression: 已发药医嘱退回拦截', () => {
|
||
test('护士端尝试退回已发药医嘱时应被拦截并提示', async ({ page }) => {
|
||
// 1. 护士登录
|
||
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(/\/nurse/);
|
||
|
||
// 2. 进入医嘱校对 -> 已校对页签
|
||
await page.goto('/nurse/order-verify');
|
||
await page.click('text=已校对');
|
||
await page.waitForTimeout(1000); // 等待数据加载
|
||
|
||
// 3. 模拟勾选一条状态为“已发药”的医嘱(假设列表中存在)
|
||
// 实际测试中可通过 API 预置数据或根据 UI 状态筛选
|
||
const dispensedRow = page.locator('tr:has-text("已发药")').first();
|
||
await dispensedRow.locator('input[type="checkbox"]').check();
|
||
|
||
// 4. 点击退回按钮
|
||
const returnBtn = page.locator('button:has-text("退回")');
|
||
await returnBtn.click();
|
||
|
||
// 5. 验证系统拦截提示
|
||
const errorMsg = page.locator('.el-message--error, .el-notification__content');
|
||
await expect(errorMsg).toContainText('该药品已由药房发放,请先执行退药处理,不可直接退回');
|
||
|
||
// 6. 验证医嘱未流转至“已退回”页签
|
||
await page.click('text=已退回');
|
||
await expect(page.locator('tr:has-text("头孢哌酮钠舒巴坦钠")')).toHaveCount(0);
|
||
});
|
||
});
|
||
|
||
/**
|
||
* @bug544 @regression
|
||
* 验证 Bug #544:排队队列列表显示“完诊”状态且支持历史队列查询
|
||
*/
|
||
test.describe('Bug #544 Regression: 智能分诊队列完诊状态显示与历史查询', () => {
|
||
test('应能查询到完诊状态患者并支持按日期检索历史队列', async ({ page }) => {
|
||
await page.goto('/login');
|
||
await page.fill('input[name="username"]', 'nkhs1');
|
||
await page.fill('input[name="password"]', '123456');
|
||
await page.click('button[type="submit"]');
|
||
await page.waitForURL(/\/triage/);
|
||
|
||
// 1. 验证列表包含“完诊”状态
|
||
await page.goto('/triage/queue');
|
||
await page.waitForTimeout(1000);
|
||
const completedRow = page.locator('tr:has-text("完诊")').first();
|
||
await expect(completedRow).toBeVisible();
|
||
|
||
// 2. 验证历史查询功能入口存在
|
||
const dateRangePicker = page.locator('.el-date-editor--daterange');
|
||
await expect(dateRangePicker).toBeVisible();
|
||
|
||
// 3. 模拟选择历史日期并查询
|
||
await dateRangePicker.click();
|
||
await page.click('text=上一月'); // 简单模拟切换月份
|
||
await page.click('button:has-text("查询")');
|
||
await page.waitForTimeout(1000);
|
||
|
||
// 验证查询后列表仍正常渲染(无报错)
|
||
const tableRows = page.locator('.el-table__body-wrapper tr');
|
||
await expect(tableRows).toHaveCount({ min: 1 });
|
||
});
|
||
});
|