-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplitModalTable.ts
More file actions
68 lines (53 loc) · 1.43 KB
/
SplitModalTable.ts
File metadata and controls
68 lines (53 loc) · 1.43 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { expect, Locator, Page } from '@playwright/test';
import BasePageModel from '@/pages/BasePageModel';
class SplitModalTable extends BasePageModel {
constructor(page: Page) {
super(page);
}
get table() {
return this.page.getByRole('table');
}
get rows() {
return this.table.getByRole('row');
}
row(index: number) {
return new Row(this.page, this.rows.nth(index));
}
get qtyValidationTooltip() {
return this.page.getByRole('tooltip');
}
assertValidationOnQtyField = async (errorContent: string) => {
await expect(this.qtyValidationTooltip).toContainText(errorContent);
};
}
class Row extends BasePageModel {
row: Locator;
constructor(page: Page, row: Locator) {
super(page);
this.row = row;
}
get deleteButton() {
return this.row.getByTestId('delete-button');
}
async getPutawayBin(putawayBin: string) {
await this.row
.getByTestId('bin-select')
.getByRole('textbox')
.fill(putawayBin);
await this.page
.getByTestId('custom-select-dropdown-menu')
.locator('.react-select__option')
.nth(0)
.click();
}
get quantityField() {
return this.row.getByRole('cell').getByTestId('quantity-input');
}
get clearBinSelect() {
return this.row.locator('.react-select__clear-indicator');
}
get putawayBinField() {
return this.row.getByTestId('bin-select').getByRole('textbox');
}
}
export default SplitModalTable;