|
|
@@ -10,9 +10,9 @@ export class DisabilityPersonManagementPage {
|
|
|
|
|
|
constructor(page: Page) {
|
|
|
this.page = page;
|
|
|
- this.pageTitle = page.getByRole('heading', { name: '残疾人个人管理' });
|
|
|
- this.addPersonButton = page.getByTestId('add-disabled-person-button');
|
|
|
- this.keywordSearchInput = page.getByTestId('keyword-search-input');
|
|
|
+ this.pageTitle = page.getByText('残疾人个人管理');
|
|
|
+ this.addPersonButton = page.getByRole('button', { name: '新增残疾人' });
|
|
|
+ this.keywordSearchInput = page.getByPlaceholder('搜索姓名或身份证号');
|
|
|
this.searchButton = page.getByRole('button', { name: '搜索' });
|
|
|
this.personTable = page.locator('table');
|
|
|
}
|
|
|
@@ -20,7 +20,9 @@ export class DisabilityPersonManagementPage {
|
|
|
async goto() {
|
|
|
await this.page.goto('/admin/disabilities');
|
|
|
await this.page.waitForLoadState('domcontentloaded');
|
|
|
- await this.page.waitForSelector('h1:has-text("残疾人个人管理")', { state: 'visible', timeout: 15000 });
|
|
|
+ // 等待页面标题出现
|
|
|
+ await this.pageTitle.waitFor({ state: 'visible', timeout: 15000 });
|
|
|
+ // 等待表格数据加载
|
|
|
await this.page.waitForSelector('table tbody tr', { state: 'visible', timeout: 20000 });
|
|
|
await this.expectToBeVisible();
|
|
|
}
|