test: 增强Playwright E2E测试方案 - 新增手术计费/医生站/并发测试用例
- 新增页面对象: SurgeryBillingPage, DoctorStationPage - 新增测试用例: 手术计费防重复(#437), 签发耗材验证(#443), 并发操作测试 - 增强登录测试: 多场景覆盖 - 完善测试数据工具: 支持多角色用户配置 - 清理冗余备份文件
This commit is contained in:
49
openhis-ui-vue3/tests/e2e/pages/SurgeryBillingPage.ts
Normal file
49
openhis-ui-vue3/tests/e2e/pages/SurgeryBillingPage.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Page, expect } from '@playwright/test';
|
||||
|
||||
/**
|
||||
* 手术计费页面对象模型
|
||||
* 覆盖:手术计费、耗材签发、防重复提交
|
||||
*/
|
||||
export class SurgeryBillingPage {
|
||||
readonly page: Page;
|
||||
readonly surgeryList = page.locator('el-table, .el-table');
|
||||
readonly generateBtn = page.locator('button:has-text("生成"), button:has-text("生成收费项")');
|
||||
readonly addBtn = page.locator('button:has-text("新增")');
|
||||
readonly saveBtn = page.locator('button:has-text("保存"), button:has-text("提交")');
|
||||
readonly signBtn = page.locator('button:has-text("签发")');
|
||||
readonly successMessage = page.locator('.el-message--success');
|
||||
readonly errorMessage = page.locator('.el-message--error');
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
async goto() {
|
||||
await this.page.goto('/operatingroom');
|
||||
await this.page.waitForLoadState('networkidle');
|
||||
}
|
||||
|
||||
async generateCharges() {
|
||||
await this.generateBtn.click();
|
||||
await this.page.waitForLoadState('networkidle');
|
||||
}
|
||||
|
||||
async rapidClickGenerate(times: number = 5) {
|
||||
for (let i = 0; i < times; i++) {
|
||||
await this.generateBtn.click().catch(() => {});
|
||||
}
|
||||
await this.page.waitForLoadState('networkidle');
|
||||
}
|
||||
|
||||
async getDialogCount(): Promise<number> {
|
||||
return await this.page.locator('.el-dialog, .el-message-box').count();
|
||||
}
|
||||
|
||||
async expectNoLocationIdError() {
|
||||
await expect(this.page.locator('text=发放库房为空')).toHaveCount(0, { timeout: 5000 });
|
||||
}
|
||||
|
||||
async expectSaveSuccess() {
|
||||
await expect(this.successMessage).toBeVisible({ timeout: 10000 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user