Skip to content

Commit 368b723

Browse files
committed
update refresh cashes in all putaway tests
1 parent 2eced71 commit 368b723

10 files changed

Lines changed: 93 additions & 38 deletions

src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Assert attempt to edit completed putaway', () => {
@@ -90,8 +91,10 @@ test.describe('Assert attempt to edit completed putaway', () => {
9091
await test.step('Go to create putaway page', async () => {
9192
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
9293
await stockMovementShowPage.isLoaded();
93-
await navbar.profileButton.click();
94-
await navbar.refreshCachesButton.click();
94+
await RefreshCachesUtils.refreshCaches({
95+
navbar,
96+
page,
97+
});
9598
await navbar.inbound.click();
9699
await navbar.createPutaway.click();
97100
await createPutawayPage.isLoaded();

src/tests/putaway/assertPutawayDetailsPage.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Assert putaway details page', () => {
@@ -97,8 +98,10 @@ test.describe('Assert putaway details page', () => {
9798
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
9899
await stockMovementShowPage.isLoaded();
99100
await expect(stockMovementShowPage.statusTag).toHaveText('Received');
100-
await navbar.profileButton.click();
101-
await navbar.refreshCachesButton.click();
101+
await RefreshCachesUtils.refreshCaches({
102+
navbar,
103+
page,
104+
});
102105
});
103106

104107
await test.step('Go to create putaway page', async () => {
@@ -140,7 +143,7 @@ test.describe('Assert putaway details page', () => {
140143
});
141144

142145
await test.step('Go to putaway view page and assert page elements', async () => {
143-
const row = putawayListPage.table.row(1)
146+
const row = putawayListPage.table.row(1);
144147
await row.actionsButton.click();
145148
await row.viewOrderDetails.click();
146149
await putawayDetailsPage.isLoaded();

src/tests/putaway/changeLocationOnCreatePutawayPage.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Change location on putaway create page and list pages', () => {
@@ -76,6 +77,7 @@ test.describe('Change location on putaway create page and list pages', () => {
7677
test('Change location on putaway create page and list page', async ({
7778
stockMovementShowPage,
7879
navbar,
80+
page,
7981
createPutawayPage,
8082
locationChooser,
8183
productService,
@@ -95,8 +97,10 @@ test.describe('Change location on putaway create page and list pages', () => {
9597
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
9698
await stockMovementShowPage.isLoaded();
9799
await expect(stockMovementShowPage.statusTag).toHaveText('Received');
98-
await navbar.profileButton.click();
99-
await navbar.refreshCachesButton.click();
100+
await RefreshCachesUtils.refreshCaches({
101+
navbar,
102+
page,
103+
});
100104
});
101105

102106
await test.step('Go to create putaway page and assert its content', async () => {
@@ -120,8 +124,10 @@ test.describe('Change location on putaway create page and list pages', () => {
120124
.getOrganization(depotLocation.organization?.name as string)
121125
.click();
122126
await locationChooser.getLocation(depotLocation.name).click();
123-
await navbar.profileButton.click();
124-
await navbar.refreshCachesButton.click();
127+
await RefreshCachesUtils.refreshCaches({
128+
navbar,
129+
page,
130+
});
125131
await createPutawayPage.goToPage();
126132
await expect(createPutawayPage.emptyCreatePageInformation).toBeVisible();
127133
await expect(

src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Create more than 1 putaway from the same item', () => {
@@ -81,6 +82,7 @@ test.describe('Create more than 1 putaway from the same item', () => {
8182
test('Create more than 1 putaway from the same item', async ({
8283
stockMovementShowPage,
8384
navbar,
85+
page,
8486
createPutawayPage,
8587
internalLocationService,
8688
productShowPage,
@@ -170,8 +172,10 @@ test.describe('Create more than 1 putaway from the same item', () => {
170172
await expect(
171173
productShowPage.inStockTabSection.row(1).quantityOnHand
172174
).toHaveText('5');
173-
await navbar.profileButton.click();
174-
await navbar.refreshCachesButton.click();
175+
await RefreshCachesUtils.refreshCaches({
176+
navbar,
177+
page,
178+
});
175179
});
176180

177181
await test.step('Go to create putaway page and assert receiving bin', async () => {

src/tests/putaway/createPutaway.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Putaway received inbound shipment', () => {
@@ -81,6 +82,7 @@ test.describe('Putaway received inbound shipment', () => {
8182
test('Create putaway from inbound stock movement', async ({
8283
stockMovementShowPage,
8384
navbar,
85+
page,
8486
createPutawayPage,
8587
internalLocationService,
8688
productShowPage,
@@ -91,8 +93,10 @@ test.describe('Putaway received inbound shipment', () => {
9193
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
9294
await stockMovementShowPage.isLoaded();
9395
await expect(stockMovementShowPage.statusTag).toHaveText('Received');
94-
await navbar.profileButton.click();
95-
await navbar.refreshCachesButton.click();
96+
await RefreshCachesUtils.refreshCaches({
97+
navbar,
98+
page,
99+
});
96100
});
97101

98102
await test.step('Go to create putaway page', async () => {
@@ -131,7 +135,7 @@ test.describe('Putaway received inbound shipment', () => {
131135
await putawayDetailsPage.summaryTab.click();
132136
productService.setProduct('5');
133137
const product = await productService.getProduct();
134-
await productShowPage.goToPage(product.id)
138+
await productShowPage.goToPage(product.id);
135139
await productShowPage.inStockTab.click();
136140
await productShowPage.inStockTabSection.isLoaded();
137141
const internalLocation = await internalLocationService.getLocation();

src/tests/putaway/putawayMoreThan1Item.test.ts

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Create putaway for more than 1 item, separate putaways', () => {
@@ -87,6 +88,7 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => {
8788
test('Create putaway from inbound stock movement for 2 items, 2 separate putaways', async ({
8889
stockMovementShowPage,
8990
navbar,
91+
page,
9092
createPutawayPage,
9193
internalLocationService,
9294
productShowPage,
@@ -105,8 +107,10 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => {
105107
await test.step('Go to create putaway page', async () => {
106108
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
107109
await stockMovementShowPage.isLoaded();
108-
await navbar.profileButton.click();
109-
await navbar.refreshCachesButton.click();
110+
await RefreshCachesUtils.refreshCaches({
111+
navbar,
112+
page,
113+
});
110114
await navbar.inbound.click();
111115
await navbar.createPutaway.click();
112116
await createPutawayPage.isLoaded();
@@ -164,7 +168,7 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => {
164168
await test.step('Go to putaway list page and edit created pending putaway', async () => {
165169
await putawayListPage.goToPage();
166170
await putawayListPage.isLoaded();
167-
const row = putawayListPage.table.row(1)
171+
const row = putawayListPage.table.row(1);
168172
await row.actionsButton.click();
169173
await row.viewOrderDetails.click();
170174
await putawayDetailsPage.isLoaded();
@@ -187,8 +191,10 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => {
187191
});
188192

189193
await test.step('Go to create putaway page and start putaway for 2nd item', async () => {
190-
await navbar.profileButton.click();
191-
await navbar.refreshCachesButton.click();
194+
await RefreshCachesUtils.refreshCaches({
195+
navbar,
196+
page,
197+
});
192198
await createPutawayPage.goToPage();
193199
await createPutawayPage.table
194200
.row(0)
@@ -231,8 +237,10 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => {
231237
});
232238

233239
await test.step('Assert empty create putaway page', async () => {
234-
await navbar.profileButton.click();
235-
await navbar.refreshCachesButton.click();
240+
await RefreshCachesUtils.refreshCaches({
241+
navbar,
242+
page,
243+
});
236244
await createPutawayPage.goToPage();
237245
await expect(createPutawayPage.emptyCreatePageInformation).toBeVisible();
238246
});
@@ -321,6 +329,7 @@ test.describe('Putaway 2 items in the same putaway', () => {
321329
test('Create putaway from inbound stock movement for 2 items', async ({
322330
stockMovementShowPage,
323331
navbar,
332+
page,
324333
createPutawayPage,
325334
internalLocationService,
326335
productShowPage,
@@ -338,8 +347,10 @@ test.describe('Putaway 2 items in the same putaway', () => {
338347
await test.step('Go to create putaway page', async () => {
339348
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
340349
await stockMovementShowPage.isLoaded();
341-
await navbar.profileButton.click();
342-
await navbar.refreshCachesButton.click();
350+
await RefreshCachesUtils.refreshCaches({
351+
navbar,
352+
page,
353+
});
343354
await navbar.inbound.click();
344355
await navbar.createPutaway.click();
345356
await createPutawayPage.isLoaded();
@@ -408,8 +419,10 @@ test.describe('Putaway 2 items in the same putaway', () => {
408419
});
409420

410421
await test.step('Assert empty create putaway page', async () => {
411-
await navbar.profileButton.click();
412-
await navbar.refreshCachesButton.click();
422+
await RefreshCachesUtils.refreshCaches({
423+
navbar,
424+
page,
425+
});
413426
await createPutawayPage.goToPage();
414427
await expect(createPutawayPage.emptyCreatePageInformation).toBeVisible();
415428
});

src/tests/putaway/putawayToPreferredBin.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Putaway to preferred bin and default bin', () => {
@@ -116,6 +117,7 @@ test.describe('Putaway to preferred bin and default bin', () => {
116117
test('Create putaway for product with preferred bin assigned and without it', async ({
117118
stockMovementShowPage,
118119
navbar,
120+
page,
119121
createPutawayPage,
120122
internalLocationService,
121123
productShowPage,
@@ -133,8 +135,10 @@ test.describe('Putaway to preferred bin and default bin', () => {
133135
await test.step('Go to create putaway page', async () => {
134136
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
135137
await stockMovementShowPage.isLoaded();
136-
await navbar.profileButton.click();
137-
await navbar.refreshCachesButton.click();
138+
await RefreshCachesUtils.refreshCaches({
139+
navbar,
140+
page,
141+
});
138142
await navbar.inbound.click();
139143
await navbar.createPutaway.click();
140144
await createPutawayPage.isLoaded();
@@ -214,6 +218,7 @@ test.describe('Putaway to preferred bin and default bin', () => {
214218
test('Edit putaway bin when preferred bin assigned automatically', async ({
215219
stockMovementShowPage,
216220
navbar,
221+
page,
217222
createPutawayPage,
218223
internalLocationService,
219224
internalLocation2Service,
@@ -231,8 +236,10 @@ test.describe('Putaway to preferred bin and default bin', () => {
231236
await test.step('Go to create putaway page', async () => {
232237
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
233238
await stockMovementShowPage.isLoaded();
234-
await navbar.profileButton.click();
235-
await navbar.refreshCachesButton.click();
239+
await RefreshCachesUtils.refreshCaches({
240+
navbar,
241+
page,
242+
});
236243
await navbar.inbound.click();
237244
await navbar.createPutaway.click();
238245
await createPutawayPage.isLoaded();

src/tests/putaway/qtyValidationsInPutaways.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Assert qty validations in putaways', () => {
@@ -76,6 +77,7 @@ test.describe('Assert qty validations in putaways', () => {
7677
test('Assert qty validations in putaways', async ({
7778
stockMovementShowPage,
7879
navbar,
80+
page,
7981
createPutawayPage,
8082
internalLocationService,
8183
}) => {
@@ -84,8 +86,10 @@ test.describe('Assert qty validations in putaways', () => {
8486
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
8587
await stockMovementShowPage.isLoaded();
8688
await expect(stockMovementShowPage.statusTag).toHaveText('Received');
87-
await navbar.profileButton.click();
88-
await navbar.refreshCachesButton.click();
89+
await RefreshCachesUtils.refreshCaches({
90+
navbar,
91+
page,
92+
});
8993
});
9094

9195
await test.step('Go to create putaway page', async () => {

src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22
import { ShipmentType } from '@/constants/ShipmentType';
33
import { expect, test } from '@/fixtures/fixtures';
44
import { StockMovementResponse } from '@/types';
5+
import RefreshCachesUtils from '@/utils/RefreshCaches';
56
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';
67

78
test.describe('Rollback last receipt behavior when putaway created', () => {
@@ -79,6 +80,7 @@ test.describe('Rollback last receipt behavior when putaway created', () => {
7980
test('Rollback last receipt behavior when putaway created', async ({
8081
stockMovementShowPage,
8182
navbar,
83+
page,
8284
createPutawayPage,
8385
internalLocationService,
8486
receivingPage,
@@ -89,8 +91,10 @@ test.describe('Rollback last receipt behavior when putaway created', () => {
8991
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
9092
await stockMovementShowPage.isLoaded();
9193
await expect(stockMovementShowPage.statusTag).toHaveText('Received');
92-
await navbar.profileButton.click();
93-
await navbar.refreshCachesButton.click();
94+
await RefreshCachesUtils.refreshCaches({
95+
navbar,
96+
page,
97+
});
9498
});
9599

96100
await test.step('Go to create putaway page', async () => {
@@ -152,7 +156,7 @@ test.describe('Rollback last receipt behavior when putaway created', () => {
152156
});
153157

154158
await test.step('Open putaway details page', async () => {
155-
const row = putawayListPage.table.row(1)
159+
const row = putawayListPage.table.row(1);
156160
await row.actionsButton.click();
157161
await row.viewOrderDetails.click();
158162
await putawayDetailsPage.isLoaded();

0 commit comments

Comments
 (0)