- 修复LoginPage/SurgeryBillingPage/DoctorStationPage中page变量作用域问题 - 新增根目录playwright.config.ts(解决配置加载问题) - .gitignore添加test-results和report目录排除
27 lines
753 B
TypeScript
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');
|
|
}
|
|
}
|