-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable.page.ts
39 lines (33 loc) · 1.21 KB
/
table.page.ts
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
import { type Page, type Locator , expect } from '@playwright/test';
export default class TablePage {
readonly page: Page;
readonly tblPrices: Locator;
readonly tblPricesBody: Locator;
readonly tblPricesFoot: Locator;
readonly tblPricesTotal: Locator;
readonly tblPeople: Locator;
readonly chkRaj: Locator;
readonly tblSort: Locator;
readonly tblHdDessert: Locator;
readonly tblColDataDesserts: Locator;
constructor(page: Page) {
this.page = page;
this.tblPrices = page.locator('#shopping');
this.tblPricesBody = this.tblPrices.locator("tbody");
this.tblPricesFoot = this.tblPrices.locator("tfoot");
this.tblPricesTotal = this.tblPricesFoot.locator("td").last();
this.tblPeople = page.locator('#simpletable');
this.chkRaj = page.locator('#second');
this.tblSort = page.locator('table.mat-sort');
this.tblHdDessert = page.locator('th[mat-sort-header="name"]');
this.tblColDataDesserts = page.locator('table.mat-sort tr td:first-child');
}
async checkRajCheckbox(){
const rows = this.tblPeople.locator("tbody tr");
const rajRow = rows.filter({
has: this.page.locator('td'),
hasText: 'Raj'
})
await rajRow.locator('input').check();
}
}