Skip to content

Commit 74683a1

Browse files
committed
improve page elements
1 parent 97a7736 commit 74683a1

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/pages/putaway/putawayDetails/components/ItemStatusTable.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ class ItemStatusTable extends BasePageModel {
88
}
99

1010
get table() {
11-
return this.page.getByRole('table');
11+
return this.page.getByTestId('item-status-table');
1212
}
1313

1414
get rows() {
15-
return this.table.getByRole('cell');
15+
return this.table.getByRole('row');
1616
}
1717

1818
row(index: number) {
@@ -32,21 +32,15 @@ class Row extends BasePageModel {
3232
}
3333

3434
get itemStatus() {
35-
return this.page
36-
.getByTestId('item-status-table')
37-
.getByTestId('order-item-status-code');
35+
return this.row.getByTestId('order-item-status-code');
3836
}
3937

4038
get originBin() {
41-
return this.page
42-
.getByTestId('item-status-table')
43-
.getByTestId('origin-bin-location');
39+
return this.row.getByTestId('origin-bin-location');
4440
}
4541

4642
get destinationBin() {
47-
return this.page
48-
.getByTestId('item-status-table')
49-
.getByTestId('destination-bin-location');
43+
return this.row.getByTestId('destination-bin-location');
5044
}
5145
}
5246

src/tests/putaway/assertPutawayDetailsPage.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ test.describe('Assert putaway details page', () => {
211211

212212
await test.step('Assert content of items status table', async () => {
213213
await expect(
214-
putawayDetailsPage.itemStatusTable.row(0).itemStatus
214+
putawayDetailsPage.itemStatusTable.row(1).itemStatus
215215
).toHaveText('PENDING');
216216
await expect(
217-
putawayDetailsPage.itemStatusTable.row(0).originBin
217+
putawayDetailsPage.itemStatusTable.row(1).originBin
218218
).toHaveText(receivingBin);
219219
await expect(
220-
putawayDetailsPage.itemStatusTable.row(0).destinationBin
220+
putawayDetailsPage.itemStatusTable.row(1).destinationBin
221221
).toHaveText(internalLocation.name);
222222
});
223223

0 commit comments

Comments
 (0)