-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemployee-list.page.ts
More file actions
48 lines (39 loc) · 1.36 KB
/
employee-list.page.ts
File metadata and controls
48 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Page, Locator } from '@playwright/test';
import { BaseListPage } from './base-list.page';
/**
* Employee List Page Object
*
* Employee-specific extension of BaseListPage.
* All shared list behaviour (search, pagination, CRUD buttons, permission checks)
* lives in BaseListPage.
*
* This class provides:
* - Employee-specific method aliases for backwards compatibility
* - Pagination info helper
*/
export class EmployeeListPage extends BaseListPage {
constructor(page: Page) {
super(page, '/employees', 'employees');
}
// ── Employee-named aliases (keep tests readable) ────────────────────────
async getEmployeeCount(): Promise<number> {
return this.getRowCount();
}
getEmployeeRow(index: number): Locator {
return this.getRow(index);
}
getEmployeeByName(name: string): Locator {
return this.getRowByText(name);
}
async clickEmployee(index: number) {
await this.clickRow(index);
}
async clickEmployeeByName(name: string) {
await this.getRowByText(name).click();
await this.page.waitForTimeout(1000);
}
// ── Back-compat alias for getRowData ───────────────────────────────────
async getEmployeeData(rowIndex: number): Promise<string[]> {
return this.getRowData(rowIndex);
}
}