Files
his/openhis-ui-vue3/tests/e2e/pages/SurgeryBillingPage.ts
2026-05-27 08:59:07 +08:00

35 lines
956 B
TypeScript
Executable File

import { Page, expect } from '@playwright/test';
export class SurgeryBillingPage {
readonly page: Page;
constructor(page: Page) {
this.page = page;
}
async goto() {
await this.page.goto('/operatingroom');
await this.page.waitForLoadState('networkidle');
}
async rapidClickGenerate(times: number = 5) {
const btn = this.page.locator('button:has-text("生成"), button:has-text("新增")');
for (let i = 0; i < times; i++) {
await btn.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.page.locator('.el-message--success')).toBeVisible({ timeout: 10000 });
}
}