-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartPutawayTable.ts
More file actions
87 lines (66 loc) · 1.83 KB
/
StartPutawayTable.ts
File metadata and controls
87 lines (66 loc) · 1.83 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { expect, Locator, Page } from '@playwright/test';
import BasePageModel from '@/pages/BasePageModel';
class StartPutawayTable extends BasePageModel {
constructor(page: Page) {
super(page);
}
get table() {
return this.page.getByTestId('wizardPage').getByRole('grid');
}
get rows() {
return this.table.getByRole('rowgroup');
}
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 editButton() {
return this.row.getByTestId('edit-button');
}
get splitLineButton() {
return this.row.getByTestId('open-modal');
}
get deleteButton() {
return this.row.getByTestId('delete-button');
}
getItem(name: string) {
return this.row.getByTestId('label-field').getByText(name);
}
get putawayBinSelect() {
return this.row.getByTestId('select-bin');
}
getPutawayBin(putawayBin: string) {
return this.page
.getByTestId('custom-select-dropdown-menu')
.getByRole('listitem')
.getByText(putawayBin, { exact: true });
}
getCurrentBin(currentBin: string) {
return this.row.getByTestId('table-cell').getByText(currentBin);
}
get preferredBin() {
return this.row.getByTestId('table-cell').nth(8);
}
get quantityField() {
return this.row.getByTestId('table-cell').nth(7);
}
get quantityInput() {
return this.row.getByTestId('quantity-input');
}
get splitLineInPutawayBin() {
return this.row.getByTestId('open-modal');
}
}
export default StartPutawayTable;