test: 增强Playwright E2E测试方案 - 新增手术计费/医生站/并发测试用例
- 新增页面对象: SurgeryBillingPage, DoctorStationPage - 新增测试用例: 手术计费防重复(#437), 签发耗材验证(#443), 并发操作测试 - 增强登录测试: 多场景覆盖 - 完善测试数据工具: 支持多角色用户配置 - 清理冗余备份文件
This commit is contained in:
43
openhis-ui-vue3/tests/e2e/specs/surgery-billing.spec.ts
Normal file
43
openhis-ui-vue3/tests/e2e/specs/surgery-billing.spec.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { LoginPage } from '../pages/LoginPage';
|
||||
import { SurgeryBillingPage } from '../pages/SurgeryBillingPage';
|
||||
import { TEST_USERS, TEST_URLS } from '../utils/test-data';
|
||||
|
||||
test.describe('💊 手术计费模块', () => {
|
||||
let loginPage: LoginPage;
|
||||
let surgeryPage: SurgeryBillingPage;
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
loginPage = new LoginPage(page);
|
||||
surgeryPage = new SurgeryBillingPage(page);
|
||||
await loginPage.goto();
|
||||
await loginPage.login(TEST_USERS.admin.username, TEST_USERS.admin.password);
|
||||
await loginPage.expectLoginSuccess();
|
||||
});
|
||||
|
||||
test('#437 快速连续点击防重复 @bug437 @smoke', async () => {
|
||||
await surgeryPage.goto();
|
||||
|
||||
if (await surgeryPage.generateBtn.isVisible()) {
|
||||
// 模拟用户快速连点
|
||||
await surgeryPage.rapidClickGenerate(5);
|
||||
await surgeryPage.page.waitForTimeout(3000);
|
||||
|
||||
// 验证没有产生重复对话框
|
||||
const count = await surgeryPage.getDialogCount();
|
||||
expect(count).toBeLessThanOrEqual(1);
|
||||
}
|
||||
});
|
||||
|
||||
test('#443 签发耗材不报库房错误 @bug443 @smoke', async () => {
|
||||
await surgeryPage.goto();
|
||||
|
||||
if (await surgeryPage.signBtn.isVisible()) {
|
||||
await surgeryPage.signBtn.click();
|
||||
await surgeryPage.page.waitForTimeout(2000);
|
||||
|
||||
// 不应出现"发放库房为空"错误
|
||||
await surgeryPage.expectNoLocationIdError();
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user