Skip to content

Commit d41c8f2

Browse files
committed
add new pages
1 parent ea56759 commit d41c8f2

2 files changed

Lines changed: 88 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { expect, Page } from '@playwright/test';
2+
3+
import BasePageModel from '@/pages/BasePageModel';
4+
5+
import SplitModalTable from './SplitModalTable';
6+
7+
class SplitModal extends BasePageModel {
8+
table: SplitModalTable;
9+
10+
constructor(page: Page) {
11+
super(page);
12+
this.table = new SplitModalTable(page);
13+
}
14+
15+
get modal() {
16+
return this.page.locator('.ReactModal__Content');
17+
}
18+
19+
async isLoaded() {
20+
await expect(this.modal).toBeVisible();
21+
}
22+
23+
get saveButton() {
24+
return this.modal.getByTestId('save-button');
25+
}
26+
27+
get cancelButton() {
28+
return this.modal.getByTestId('cancel-button');
29+
}
30+
31+
get addLineButton() {
32+
return this.modal.getByTestId('add-line-button');
33+
}
34+
}
35+
36+
export default SplitModal;
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { Locator, Page } from '@playwright/test';
2+
3+
import BasePageModel from '@/pages/BasePageModel';
4+
5+
class SplitModalTable extends BasePageModel {
6+
constructor(page: Page) {
7+
super(page);
8+
}
9+
10+
get table() {
11+
return this.page.getByRole('table');
12+
}
13+
14+
get rows() {
15+
return this.table.getByRole('row');
16+
}
17+
18+
row(index: number) {
19+
return new Row(this.page, this.rows.nth(index));
20+
}
21+
}
22+
23+
class Row extends BasePageModel {
24+
row: Locator;
25+
26+
constructor(page: Page, row: Locator) {
27+
super(page);
28+
this.row = row;
29+
}
30+
31+
get deleteButton() {
32+
return this.row.getByTestId('delete-button');
33+
}
34+
35+
async getPutawayBin(putawayBin: string) {
36+
await this.row
37+
.getByTestId('bin-select')
38+
.getByRole('textbox')
39+
.fill(putawayBin);
40+
await this.page
41+
.getByTestId('custom-select-dropdown-menu')
42+
.locator('.react-select__option')
43+
.nth(0)
44+
.click();
45+
}
46+
47+
get quantityField() {
48+
return this.row.getByRole('cell').getByTestId('quantity-input');
49+
}
50+
}
51+
52+
export default SplitModalTable;

0 commit comments

Comments
 (0)