104 lines
4.1 KiB
TypeScript
Executable File
104 lines
4.1 KiB
TypeScript
Executable File
import { test, expect } from '@playwright/test';
|
|
|
|
// ... 原有测试用例 ...
|
|
|
|
// @bug503 @regression
|
|
test('Bug #503: 住院发退药明细与汇总单触发时机同步校验', 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('/nurse-station');
|
|
|
|
await page.click('text=执行医嘱');
|
|
await page.click('text=盐酸普罗帕酮注射液');
|
|
await page.click('text=确认执行');
|
|
await page.waitForTimeout(1000);
|
|
|
|
await page.goto('/pharmacy/dispensing');
|
|
const detailRows = await page.locator('.dispensing-detail-table tbody tr').count();
|
|
const summaryRows = await page.locator('.dispensing-summary-table tbody tr').count();
|
|
expect(detailRows).toBe(0);
|
|
expect(summaryRows).toBe(0);
|
|
|
|
await page.goto('/nurse-station/dispensing-apply');
|
|
await page.check('input[type="checkbox"]');
|
|
await page.click('text=汇总发药申请');
|
|
await page.click('text=确认提交');
|
|
await page.waitForTimeout(1500);
|
|
|
|
await page.goto('/pharmacy/dispensing');
|
|
await page.waitForSelector('.dispensing-detail-table tbody tr');
|
|
const newDetailRows = await page.locator('.dispensing-detail-table tbody tr').count();
|
|
const newSummaryRows = await page.locator('.dispensing-summary-table tbody tr').count();
|
|
|
|
expect(newDetailRows).toBeGreaterThan(0);
|
|
expect(newSummaryRows).toBeGreaterThan(0);
|
|
expect(newDetailRows).toBe(newSummaryRows);
|
|
});
|
|
|
|
// @bug544 @regression
|
|
test('Bug #544: 智能分诊队列显示完诊状态及历史查询功能', 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/queue');
|
|
|
|
await page.locator('text=智能队列(全科)').waitFor();
|
|
const completedRow = page.locator('tr:has-text("完诊")');
|
|
await expect(completedRow).toBeVisible({ timeout: 5000 });
|
|
|
|
const dateRangePicker = page.locator('.el-date-editor--daterange');
|
|
await expect(dateRangePicker).toBeVisible();
|
|
});
|
|
|
|
// @bug570 @regression
|
|
test('Bug #570: 门诊预约挂号状态显示及查询逻辑修复', async ({ page }) => {
|
|
await page.goto('/login');
|
|
await page.fill('input[name="username"]', 'admin');
|
|
await page.fill('input[name="password"]', '123456');
|
|
await page.click('button[type="submit"]');
|
|
await page.waitForURL('/outpatient/appointment');
|
|
|
|
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);
|
|
});
|