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 { 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 }); } }