Files
his/openhis-ui-vue3/tests/e2e/pages/DoctorStationPage.ts
zhangfei 34ba7cae6a fix: 修复Playwright页面对象定义错误 + 根目录config
- 修复LoginPage/SurgeryBillingPage/DoctorStationPage中page变量作用域问题
- 新增根目录playwright.config.ts(解决配置加载问题)
- .gitignore添加test-results和report目录排除
2026-04-25 22:14:19 +08:00

27 lines
753 B
TypeScript

import { Page, expect } from '@playwright/test';
export class DoctorStationPage {
readonly page: Page;
constructor(page: Page) {
this.page = page;
}
async goto() {
await this.page.goto('/doctorstation');
await this.page.waitForLoadState('networkidle');
}
async expandCategory(index: number = 0) {
const item = this.page.locator('.el-collapse-item, .category-item').nth(index);
await item.click();
await this.page.waitForTimeout(500);
}
async searchPatient(name: string) {
await this.page.fill('input[placeholder*="患者"], input[placeholder*="姓名"]', name);
await this.page.click('button:has-text("搜索"), button:has-text("查询")');
await this.page.waitForLoadState('networkidle');
}
}