83 lines
3.4 KiB
TypeScript
Executable File
83 lines
3.4 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();
|
|
});
|
|
|
|
// @bug595 @regression
|
|
test('Bug #595: 住院护士站医嘱校对列表字段完整性与皮试高亮校验', 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.waitForSelector('.order-verify-table');
|
|
|
|
// 验证新增字段列是否存在
|
|
const expectedColumns = ['开始时间', '单次剂量', '总量', '频次/用法', '开嘱医生', '停嘱时间', '停嘱医生', '注射药品', '皮试', '诊断'];
|
|
for (const col of expectedColumns) {
|
|
await expect(page.locator(`th:has-text("${col}")`)).toBeVisible();
|
|
}
|
|
|
|
// 验证皮试医嘱红色标签高亮
|
|
const skinTestTag = page.locator('.el-tag--danger:has-text("需皮试")');
|
|
await expect(skinTestTag).toBeVisible();
|
|
|
|
// 验证数据非空且结构化展示(非纯文本拼接)
|
|
const firstRow = page.locator('.order-verify-table tbody tr').first();
|
|
await expect(firstRow.locator('td').nth(1)).not.toBeEmpty(); // 开始时间
|
|
await expect(firstRow.locator('td').nth(2)).not.toBeEmpty(); // 单次剂量
|
|
await expect(firstRow.locator('td').nth(3)).not.toBeEmpty(); // 总量
|
|
});
|