From 687a641cad1a6e75323262bf500bdd1eaa5bbc56 Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Tue, 16 Jun 2026 16:32:32 +0200 Subject: [PATCH 01/12] add elements to putaway pages --- .../putaway/components/CompletePutawayTable.ts | 8 ++++++++ src/pages/putaway/components/SplitModalTable.ts | 11 +++++++++++ src/pages/putaway/components/StartPutawayTable.ts | 15 +++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/src/pages/putaway/components/CompletePutawayTable.ts b/src/pages/putaway/components/CompletePutawayTable.ts index a8c5f2c..c796485 100644 --- a/src/pages/putaway/components/CompletePutawayTable.ts +++ b/src/pages/putaway/components/CompletePutawayTable.ts @@ -35,6 +35,14 @@ class Row extends BasePageModel { get quantity() { return this.row.getByTestId('table-cell').nth(7); } + + get preferredBin() { + return this.row.getByTestId('table-cell').nth(8); + } + + get currentBin() { + return this.row.getByTestId('table-cell').nth(9); + } } export default CompletePutawayTable; diff --git a/src/pages/putaway/components/SplitModalTable.ts b/src/pages/putaway/components/SplitModalTable.ts index 9c8c59f..3045f4f 100644 --- a/src/pages/putaway/components/SplitModalTable.ts +++ b/src/pages/putaway/components/SplitModalTable.ts @@ -63,6 +63,17 @@ class Row extends BasePageModel { get putawayBinField() { return this.row.getByTestId('bin-select').getByRole('textbox'); } + + get expandPutawayBinSelect() { + return this.row.locator('[class*="react-select__dropdown-indicator"]'); + } + + getZoneLocation(zoneLocation: string) { + return this.page + .getByTestId('custom-select-dropdown-menu') + .locator('.css-5ih5ya-group react-select__group-heading') + .getByText(zoneLocation, { exact: true }); + } } export default SplitModalTable; diff --git a/src/pages/putaway/components/StartPutawayTable.ts b/src/pages/putaway/components/StartPutawayTable.ts index 3357603..70acacf 100644 --- a/src/pages/putaway/components/StartPutawayTable.ts +++ b/src/pages/putaway/components/StartPutawayTable.ts @@ -73,6 +73,10 @@ class Row extends BasePageModel { return this.row.getByTestId('select-bin'); } + get expandPutawayBinSelect() { + return this.putawayBinSelect.locator('.react-select__dropdown-indicator'); + } + getPutawayBin(putawayBin: string) { return this.page .getByTestId('custom-select-dropdown-menu') @@ -88,6 +92,10 @@ class Row extends BasePageModel { return this.row.getByTestId('table-cell').nth(8); } + get currentdBin() { + return this.row.getByTestId('table-cell').nth(9); + } + get quantityField() { return this.row.getByTestId('table-cell').nth(7); } @@ -107,6 +115,13 @@ class Row extends BasePageModel { get expiryDateField() { return this.row.getByTestId('table-cell').nth(5); } + + getZoneLocation(zoneLocation: string) { + return this.page + .getByTestId('custom-select-dropdown-menu') + .locator('.css-5ih5ya-group react-select__group-heading') + .getByText(zoneLocation, { exact: true }); + } } export default StartPutawayTable; From 89756fb59edce4764e3a3ddc0cd4e4979392c823 Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Tue, 16 Jun 2026 16:33:29 +0200 Subject: [PATCH 02/12] add elements to location details page --- .../location/createLocation/tabs/LocationDetailsTabSection.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/location/createLocation/tabs/LocationDetailsTabSection.ts b/src/pages/location/createLocation/tabs/LocationDetailsTabSection.ts index b5338a7..8b72e19 100644 --- a/src/pages/location/createLocation/tabs/LocationDetailsTabSection.ts +++ b/src/pages/location/createLocation/tabs/LocationDetailsTabSection.ts @@ -51,6 +51,10 @@ class LocationDetailsTabSection extends BasePageModel { getZoneLocation(name: string) { return this.page.getByRole('listitem').getByText(name, { exact: true }); } + + get clearZoneLocation() { + return this.zoneLocationSelect.locator('.search-choice-close'); + } } export default LocationDetailsTabSection; From 2742510c824b65884fa6e2c908a27efcde037500 Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Tue, 16 Jun 2026 16:40:12 +0200 Subject: [PATCH 03/12] add test to assert zones in putaways --- .../putaway/assertZonesInPutaways.test.ts | 456 ++++++++++++++++++ 1 file changed, 456 insertions(+) create mode 100644 src/tests/putaway/assertZonesInPutaways.test.ts diff --git a/src/tests/putaway/assertZonesInPutaways.test.ts b/src/tests/putaway/assertZonesInPutaways.test.ts new file mode 100644 index 0000000..1b6e85e --- /dev/null +++ b/src/tests/putaway/assertZonesInPutaways.test.ts @@ -0,0 +1,456 @@ +import AppConfig from '@/config/AppConfig'; +import { LOCATION_URL } from '@/constants/applicationUrls'; +import { ShipmentType } from '@/constants/ShipmentType'; +import { expect, test } from '@/fixtures/fixtures'; +import { Product } from '@/generated/ProductCodes.generated'; +import { ProductResponse, StockMovementResponse } from '@/types'; +import RefreshCachesUtils from '@/utils/RefreshCaches'; +import { + deleteReceivedShipment, + getShipmentId, + getShipmentItemId, +} from '@/utils/shipmentUtils'; +import { byNameAsc } from '@/utils/sortUtils'; +import UniqueIdentifier from '@/utils/UniqueIdentifier'; + +test.describe('Assert zones on putaway pages', () => { + let STOCK_MOVEMENT: StockMovementResponse; + let productA: ProductResponse; + let productB: ProductResponse; + const uniqueIdentifier = new UniqueIdentifier(); + const zoneLocationName = uniqueIdentifier.generateUniqueString('zone'); + + test.beforeEach( + async ({ + supplierLocationService, + mainLocationService, + stockMovementService, + productService, + receivingService, + productShowPage, + productEditPage, + internalLocationService, + page, + locationListPage, + createLocationPage, + }) => { + const supplierLocation = await supplierLocationService.getLocation(); + const mainLocation = await mainLocationService.getLocation(); + const internalLocation = await internalLocationService.getLocation(); + STOCK_MOVEMENT = await stockMovementService.createInbound({ + originId: supplierLocation.id, + }); + + [productA, productB] = [ + await productService.getProduct(Product.FIVE), + await productService.getProduct(Product.FOUR), + ].sort(byNameAsc); + + await test.step('Create and receive stock movement', async () => { + await stockMovementService.addItemsToInboundStockMovement( + STOCK_MOVEMENT.id, + [ + { productId: productA.id, quantity: 10 }, + { productId: productB.id, quantity: 10 }, + ] + ); + + await stockMovementService.sendInboundStockMovement(STOCK_MOVEMENT.id, { + shipmentType: ShipmentType.AIR, + }); + + const { data: stockMovement } = + await stockMovementService.getStockMovement(STOCK_MOVEMENT.id); + const shipmentId = getShipmentId(stockMovement); + const { data: receipt } = await receivingService.getReceipt(shipmentId); + const receivingBin = + AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; + + await receivingService.createReceivingBin(shipmentId, receipt); + + await receivingService.updateReceivingItems(shipmentId, [ + { + shipmentItemId: getShipmentItemId(receipt, 0, 0), + quantityReceiving: 10, + binLocationName: receivingBin, + }, + { + shipmentItemId: getShipmentItemId(receipt, 0, 1), + quantityReceiving: 10, + binLocationName: receivingBin, + }, + ]); + await receivingService.completeReceipt(shipmentId); + }); + + await test.step('Create zone for location', async () => { + await page.goto(LOCATION_URL.list()); + await locationListPage.searchByLocationNameField.fill( + mainLocation.name + ); + await locationListPage.findButton.click(); + await expect( + locationListPage.getLocationEditButton(mainLocation.name) + ).toBeVisible(); + await locationListPage.getLocationEditButton(mainLocation.name).click(); + await createLocationPage.zoneLocationTab.click(); + await createLocationPage.zoneLocationTabSection.isLoaded(); + await createLocationPage.zoneLocationTabSection.addZoneLocationButton.click(); + await createLocationPage.zoneLocationTabSection.addZoneLocationDialog.zoneLocationNameField.fill( + zoneLocationName + ); + await createLocationPage.zoneLocationTabSection.addZoneLocationDialog.saveButton.click(); + await createLocationPage.zoneLocationTabSection.isLoaded(); + }); + + await test.step('Assign created zone to bin location', async () => { + await createLocationPage.binLocationTab.click(); + await createLocationPage.binLocationTabSection.isLoaded(); + await createLocationPage.binLocationTabSection.searchField.fill( + internalLocation.name + ); + await createLocationPage.binLocationTabSection.searchField.press( + 'Enter' + ); + await createLocationPage.binLocationTabSection.isLoaded(); + await createLocationPage.binLocationTabSection.editBinButton + .first() + .click(); + await createLocationPage.locationDetailsTabSection.zoneLocationSelect.click(); + await createLocationPage.locationDetailsTabSection + .getZoneLocation(zoneLocationName) + .click(); + await createLocationPage.locationDetailsTabSection.saveButton.click(); + }); + + await test.step('Assign bin with zone as preferred bin', async () => { + await productShowPage.goToPage(productB.id); + await productShowPage.editProductkButton.click(); + await productEditPage.inventoryLevelsTab.click(); + await productEditPage.inventoryLevelsTabSection.createStockLevelButton.click(); + await productEditPage.inventoryLevelsTabSection.createStockLevelModal.receivingTab.click(); + const internalLocation = await internalLocationService.getLocation(); + await productEditPage.inventoryLevelsTabSection.createStockLevelModal.defaultPutawayLocation.click(); + await productEditPage.inventoryLevelsTabSection.createStockLevelModal + .getDefaultPutawayLocation(internalLocation.name) + .click(); + await productEditPage.inventoryLevelsTabSection.createStockLevelModal.createButton.click(); + }); + } + ); + + test.afterEach( + async ({ + stockMovementShowPage, + stockMovementService, + navbar, + transactionListPage, + oldViewShipmentPage, + productService, + productShowPage, + productEditPage, + page, + locationListPage, + mainLocationService, + createLocationPage, + internalLocationService, + }) => { + await navbar.configurationButton.click(); + await navbar.transactions.click(); + for (let n = 1; n < 3; n++) { + await transactionListPage.deleteTransaction(1); + } + await deleteReceivedShipment({ + stockMovementShowPage, + oldViewShipmentPage, + stockMovementService, + STOCK_MOVEMENT, + }); + const product = await productService.getProduct(Product.FOUR); + + await test.step('Delete inventory level', async () => { + await productShowPage.goToPage(product.id); + await productShowPage.editProductkButton.click(); + await productEditPage.inventoryLevelsTab.click(); + await productEditPage.inventoryLevelsTabSection + .row(1) + .editInventoryLevelButton.click(); + await expect( + productEditPage.inventoryLevelsTabSection.table + ).toBeVisible(); + await productEditPage.inventoryLevelsTabSection.createStockLevelModal.clickDeleteInventoryLevel(); + }); + + await test.step('Remove zone from bin location', async () => { + const mainLocation = await mainLocationService.getLocation(); + const internalLocation = await internalLocationService.getLocation(); + await page.goto(LOCATION_URL.list()); + await locationListPage.searchByLocationNameField.fill( + mainLocation.name + ); + await locationListPage.findButton.click(); + await expect( + locationListPage.getLocationEditButton(mainLocation.name) + ).toBeVisible(); + await locationListPage.getLocationEditButton(mainLocation.name).click(); + await createLocationPage.binLocationTab.click(); + await createLocationPage.binLocationTabSection.isLoaded(); + await createLocationPage.binLocationTabSection.searchField.fill( + internalLocation.name + ); + await createLocationPage.binLocationTabSection.searchField.press( + 'Enter' + ); + await createLocationPage.binLocationTabSection.isLoaded(); + await createLocationPage.binLocationTabSection.editBinButton + .first() + .click(); + await createLocationPage.locationDetailsTabSection.clearZoneLocation.click(); + await createLocationPage.locationDetailsTabSection.saveButton.click(); + }); + + await test.step('Deactivate created zone location', async () => { + await createLocationPage.zoneLocationTab.click(); + await createLocationPage.zoneLocationTabSection.isLoaded(); + await createLocationPage.zoneLocationTabSection.searchField.fill( + zoneLocationName + ); + await createLocationPage.zoneLocationTabSection.searchField.press( + 'Enter' + ); + await createLocationPage.zoneLocationTabSection.isLoaded(); + await createLocationPage.zoneLocationTabSection.editZoneButton.click(); + await createLocationPage.locationConfigurationTab.click(); + await createLocationPage.locationConfigurationTabSection.activeCheckbox.uncheck(); + await createLocationPage.locationConfigurationTabSection.saveButton.click(); + }); + } + ); + + test('Create putaway and assert zones on putaway pages', async ({ + stockMovementShowPage, + navbar, + createPutawayPage, + internalLocationService, + putawayDetailsPage, + }) => { + const receivingBin = + AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; + const internalLocation = await internalLocationService.getLocation(); + + await test.step('Go to create putaway page', async () => { + await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); + await stockMovementShowPage.isLoaded(); + await RefreshCachesUtils.refreshCaches({ + navbar, + }); + await navbar.inbound.click(); + await navbar.createPutaway.click(); + await createPutawayPage.isLoaded(); + }); + + await test.step('Start 1st putaway', async () => { + await createPutawayPage.table + .row(0) + .getExpandBinLocation(receivingBin) + .click(); + await createPutawayPage.table.row(1).checkbox.click(); + await createPutawayPage.startPutawayButton.click(); + await createPutawayPage.startStep.isLoaded(); + await createPutawayPage.startStep.table.row(0).editButton.click(); + await createPutawayPage.startStep.table.row(0).quantityInput.fill('5'); + }); + + await test.step('Assert zones on start putaway page', async () => { + await createPutawayPage.startStep.table + .row(1) + .expandPutawayBinSelect.waitFor({ state: 'visible' }); + await createPutawayPage.startStep.table + .row(1) + .expandPutawayBinSelect.click(); + await createPutawayPage.startStep.table + .row(1) + .getZoneLocation(zoneLocationName) + .isVisible(); + await createPutawayPage.startStep.table + .row(1) + .getPutawayBin(internalLocation.name) + .click(); + await createPutawayPage.startStep.nextButton.click(); + }); + + await test.step('Assert zones on confirm page', async () => { + await createPutawayPage.completeStep.isLoaded(); + await expect( + createPutawayPage.completeStep.table.row(2).putawayBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + }); + + await test.step('Complete putaway', async () => { + await createPutawayPage.completeStep.completePutawayButton.click(); + await expect( + createPutawayPage.completeStep.confirmPutawayDialog + ).toBeVisible(); + await createPutawayPage.completeStep.yesButtonOnConfirmPutawayDialog.click(); + await putawayDetailsPage.isLoaded(); + await expect(putawayDetailsPage.statusTag).toHaveText('Completed'); + }); + + await test.step('Go to create putaway page', async () => { + await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); + await stockMovementShowPage.isLoaded(); + await RefreshCachesUtils.refreshCaches({ + navbar, + }); + await navbar.inbound.click(); + await navbar.createPutaway.click(); + await createPutawayPage.isLoaded(); + }); + + await test.step('Start 2nd putaway', async () => { + await createPutawayPage.table + .row(0) + .getExpandBinLocation(receivingBin) + .click(); + await createPutawayPage.table.row(1).checkbox.click(); + await createPutawayPage.table.row(2).checkbox.click(); + await createPutawayPage.startPutawayButton.click(); + await createPutawayPage.startStep.isLoaded(); + }); + + await test.step('Assert zones on start putaway page', async () => { + await expect( + createPutawayPage.startStep.table.row(1).currentdBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + await createPutawayPage.startStep.table + .row(1) + .expandPutawayBinSelect.waitFor({ state: 'visible' }); + await createPutawayPage.startStep.table + .row(1) + .expandPutawayBinSelect.click(); + await createPutawayPage.startStep.table + .row(1) + .getZoneLocation(zoneLocationName) + .isVisible(); + await createPutawayPage.startStep.table + .row(1) + .getPutawayBin(internalLocation.name) + .click(); + await expect( + createPutawayPage.startStep.table.row(2).preferredBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + await expect( + createPutawayPage.startStep.table.row(2).putawayBinSelect + ).toContainText(internalLocation.name); + await createPutawayPage.startStep.table + .row(2) + .expandPutawayBinSelect.waitFor({ state: 'visible' }); + await createPutawayPage.startStep.table + .row(2) + .expandPutawayBinSelect.click(); + await createPutawayPage.startStep.table + .row(2) + .getZoneLocation(zoneLocationName) + .isVisible(); + await createPutawayPage.startStep.table + .row(2) + .getPutawayBin(internalLocation.name) + .click(); + }); + + await test.step('Apply ordering by current bin', async () => { + await createPutawayPage.startStep.sortButton.click(); + await expect(createPutawayPage.startStep.sortButton).toContainText( + 'Sort by current bins' + ); + await expect( + createPutawayPage.startStep.table.row(1).currentdBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + await expect( + createPutawayPage.startStep.table.row(2).preferredBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + }); + + await test.step('Apply ordering by preferred bin', async () => { + await createPutawayPage.startStep.sortButton.click(); + await expect(createPutawayPage.startStep.sortButton).toContainText( + 'Sort by preferred bin' + ); + await expect( + createPutawayPage.startStep.table.row(2).currentdBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + await expect( + createPutawayPage.startStep.table.row(1).preferredBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + }); + + await test.step('Return to original order', async () => { + await createPutawayPage.startStep.sortButton.click(); + await expect(createPutawayPage.startStep.sortButton).toContainText( + 'Sort by current bins' + ); + await expect( + createPutawayPage.startStep.table.row(1).currentdBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + await expect( + createPutawayPage.startStep.table.row(2).preferredBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + }); + + await test.step('Assert zones on split line dialog', async () => { + await createPutawayPage.startStep.table + .row(0) + .splitLineButton.first() + .click(); + await createPutawayPage.startStep.splitModal.isLoaded(); + await createPutawayPage.startStep.splitModal.table + .row(1) + .expandPutawayBinSelect.click(); + await createPutawayPage.startStep.table + .row(1) + .getZoneLocation(zoneLocationName) + .isVisible(); + await createPutawayPage.startStep.splitModal.table + .row(1) + .getPutawayBin(internalLocation.name); + await createPutawayPage.startStep.splitModal.addLineButton.click(); + await createPutawayPage.startStep.splitModal.table + .row(2) + .expandPutawayBinSelect.click(); + await createPutawayPage.startStep.table + .row(2) + .getZoneLocation(zoneLocationName) + .isVisible(); + await createPutawayPage.startStep.splitModal.table + .row(2) + .getPutawayBin(internalLocation.name); + await createPutawayPage.startStep.splitModal.table + .row(2) + .quantityField.fill('5'); + await createPutawayPage.startStep.splitModal.cancelButton.click(); + await createPutawayPage.startStep.nextButton.click(); + }); + + await test.step('Assert zones on confirm page', async () => { + await createPutawayPage.completeStep.isLoaded(); + await expect( + createPutawayPage.completeStep.table.row(2).putawayBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + await expect( + createPutawayPage.completeStep.table.row(2).currentBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + await expect( + createPutawayPage.completeStep.table.row(3).putawayBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + await expect( + createPutawayPage.completeStep.table.row(3).preferredBin + ).toContainText(`${zoneLocationName}: ${internalLocation.name}`); + }); + + await test.step('Complete putaway', async () => { + await createPutawayPage.completeStep.completePutawayButton.click(); + await putawayDetailsPage.isLoaded(); + await expect(putawayDetailsPage.statusTag).toHaveText('Completed'); + }); + }); +}); From 18dffef9c53497a348d3c4aa460064e8b41cc042 Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Wed, 17 Jun 2026 09:43:38 +0200 Subject: [PATCH 04/12] improve order of items in putaway tests --- .../putaway/deleteItemsFromPutaway.test.ts | 14 ++++++----- .../performPutawayAsManagerUser.test.ts | 24 ++++++++++--------- .../putaway/putawayMoreThan1Item.test.ts | 22 ++++++++++------- .../putaway/putawayToPreferredBin.test.ts | 17 ++++++------- ...dationOnQtyRemovedFromReceivingBin.test.ts | 14 ++++++----- 5 files changed, 52 insertions(+), 39 deletions(-) diff --git a/src/tests/putaway/deleteItemsFromPutaway.test.ts b/src/tests/putaway/deleteItemsFromPutaway.test.ts index 9f9fa23..66caff9 100644 --- a/src/tests/putaway/deleteItemsFromPutaway.test.ts +++ b/src/tests/putaway/deleteItemsFromPutaway.test.ts @@ -2,16 +2,19 @@ import AppConfig from '@/config/AppConfig'; import { ShipmentType } from '@/constants/ShipmentType'; import { expect, test } from '@/fixtures/fixtures'; import { Product } from '@/generated/ProductCodes.generated'; -import { StockMovementResponse } from '@/types'; +import { ProductResponse, StockMovementResponse } from '@/types'; import RefreshCachesUtils from '@/utils/RefreshCaches'; import { deleteReceivedShipment, getShipmentId, getShipmentItemId, } from '@/utils/shipmentUtils'; +import { byNameAsc } from '@/utils/sortUtils'; test.describe('Delete items from putaway', () => { let STOCK_MOVEMENT: StockMovementResponse; + let product: ProductResponse; + let product2: ProductResponse; test.beforeEach( async ({ @@ -25,8 +28,10 @@ test.describe('Delete items from putaway', () => { originId: supplierLocation.id, }); - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); + [product, product2] = [ + await productService.getProduct(Product.FIVE), + await productService.getProduct(Product.FOUR), + ].sort(byNameAsc); await stockMovementService.addItemsToInboundStockMovement( STOCK_MOVEMENT.id, @@ -93,13 +98,10 @@ test.describe('Delete items from putaway', () => { createPutawayPage, internalLocationService, putawayDetailsPage, - productService, putawayListPage, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); const internalLocation = await internalLocationService.getLocation(); await test.step('Go to create putaway page', async () => { diff --git a/src/tests/putaway/performPutawayAsManagerUser.test.ts b/src/tests/putaway/performPutawayAsManagerUser.test.ts index 35d0a6d..725670a 100644 --- a/src/tests/putaway/performPutawayAsManagerUser.test.ts +++ b/src/tests/putaway/performPutawayAsManagerUser.test.ts @@ -6,16 +6,19 @@ import { Product } from '@/generated/ProductCodes.generated'; import CreatePutawayPage from '@/pages/putaway/CreatePutawayPage'; import PutawayDetailsPage from '@/pages/putaway/putawayDetails/PutawayDetailsPage'; import StockMovementShowPage from '@/pages/stockMovementShow/StockMovementShowPage'; -import { StockMovementResponse } from '@/types'; +import { ProductResponse, StockMovementResponse } from '@/types'; import RefreshCachesUtils from '@/utils/RefreshCaches'; import { deleteReceivedShipment, getShipmentId, getShipmentItemId, } from '@/utils/shipmentUtils'; +import { byNameAsc } from '@/utils/sortUtils'; test.describe('Perform putaway as manager user', () => { let STOCK_MOVEMENT: StockMovementResponse; + let product: ProductResponse; + let product2: ProductResponse; test.beforeEach( async ({ @@ -29,8 +32,10 @@ test.describe('Perform putaway as manager user', () => { originId: supplierLocation.id, }); - const product = await productService.getProduct(Product.THREE); - const product2 = await productService.getProduct(Product.FOUR); + [product, product2] = [ + await productService.getProduct(Product.THREE), + await productService.getProduct(Product.FOUR), + ].sort(byNameAsc); await stockMovementService.addItemsToInboundStockMovement( STOCK_MOVEMENT.id, @@ -94,12 +99,9 @@ test.describe('Perform putaway as manager user', () => { test('Perform putaway as manager user', async ({ managerUserContext, internalLocationService, - productService, }) => { const receivingBin = - AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; - const product = await productService.getProduct(Product.THREE); - const product2 = await productService.getProduct(Product.FOUR); + AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;; const internalLocation = await internalLocationService.getLocation(); const managerUserPage = await managerUserContext.newPage(); @@ -125,10 +127,10 @@ test.describe('Perform putaway as manager user', () => { .getExpandBinLocation(receivingBin) .click(); await expect( - createPutawayPage.table.row(1).getProductName(product2.name) + createPutawayPage.table.row(2).getProductName(product2.name) ).toBeVisible(); await expect( - createPutawayPage.table.row(2).getProductName(product.name) + createPutawayPage.table.row(1).getProductName(product.name) ).toBeVisible(); await createPutawayPage.table.row(1).checkbox.click(); await createPutawayPage.table.row(2).checkbox.click(); @@ -214,10 +216,10 @@ test.describe('Perform putaway as manager user', () => { .getExpandBinLocation(receivingBin) .click(); await expect( - createPutawayPage.table.row(1).getProductName(product2.name) + createPutawayPage.table.row(2).getProductName(product2.name) ).toBeVisible(); await expect( - createPutawayPage.table.row(2).getProductName(product.name) + createPutawayPage.table.row(1).getProductName(product.name) ).toBeVisible(); await managerUserPage.close(); }); diff --git a/src/tests/putaway/putawayMoreThan1Item.test.ts b/src/tests/putaway/putawayMoreThan1Item.test.ts index eb79bee..512892d 100644 --- a/src/tests/putaway/putawayMoreThan1Item.test.ts +++ b/src/tests/putaway/putawayMoreThan1Item.test.ts @@ -2,16 +2,19 @@ import AppConfig from '@/config/AppConfig'; import { ShipmentType } from '@/constants/ShipmentType'; import { expect, test } from '@/fixtures/fixtures'; import { Product } from '@/generated/ProductCodes.generated'; -import { StockMovementResponse } from '@/types'; +import { ProductResponse, StockMovementResponse } from '@/types'; import RefreshCachesUtils from '@/utils/RefreshCaches'; import { deleteReceivedShipment, getShipmentId, getShipmentItemId, } from '@/utils/shipmentUtils'; +import { byNameAsc } from '@/utils/sortUtils'; test.describe('Create putaway for more than 1 item, separate putaways', () => { let STOCK_MOVEMENT: StockMovementResponse; + let product: ProductResponse; + let product2: ProductResponse; test.beforeEach( async ({ @@ -25,8 +28,10 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { originId: supplierLocation.id, }); - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); + [product, product2] = [ + await productService.getProduct(Product.FIVE), + await productService.getProduct(Product.FOUR), + ].sort(byNameAsc); await stockMovementService.addItemsToInboundStockMovement( STOCK_MOVEMENT.id, @@ -94,13 +99,10 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { internalLocationService, productShowPage, putawayDetailsPage, - productService, putawayListPage, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); const internalLocation = await internalLocationService.getLocation(); await test.step('Go to create putaway page', async () => { @@ -245,6 +247,8 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { test.describe('Putaway 2 items in the same putaway', () => { let STOCK_MOVEMENT: StockMovementResponse; + let product: ProductResponse; + let product2: ProductResponse; test.beforeEach( async ({ @@ -258,8 +262,10 @@ test.describe('Putaway 2 items in the same putaway', () => { originId: supplierLocation.id, }); - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); + [product, product2] = [ + await productService.getProduct(Product.FIVE), + await productService.getProduct(Product.FOUR), + ].sort(byNameAsc); await stockMovementService.addItemsToInboundStockMovement( STOCK_MOVEMENT.id, diff --git a/src/tests/putaway/putawayToPreferredBin.test.ts b/src/tests/putaway/putawayToPreferredBin.test.ts index 49429ec..b979b0b 100644 --- a/src/tests/putaway/putawayToPreferredBin.test.ts +++ b/src/tests/putaway/putawayToPreferredBin.test.ts @@ -2,16 +2,19 @@ import AppConfig from '@/config/AppConfig'; import { ShipmentType } from '@/constants/ShipmentType'; import { expect, test } from '@/fixtures/fixtures'; import { Product } from '@/generated/ProductCodes.generated'; -import { StockMovementResponse } from '@/types'; +import { ProductResponse, StockMovementResponse } from '@/types'; import RefreshCachesUtils from '@/utils/RefreshCaches'; import { deleteReceivedShipment, getShipmentId, getShipmentItemId, } from '@/utils/shipmentUtils'; +import { byNameAsc } from '@/utils/sortUtils'; test.describe('Putaway to preferred bin and default bin', () => { let STOCK_MOVEMENT: StockMovementResponse; + let product: ProductResponse; + let product2: ProductResponse; test.beforeEach( async ({ @@ -28,8 +31,10 @@ test.describe('Putaway to preferred bin and default bin', () => { originId: supplierLocation.id, }); - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); + [product, product2] = [ + await productService.getProduct(Product.FIVE), + await productService.getProduct(Product.FOUR), + ].sort(byNameAsc); await stockMovementService.addItemsToInboundStockMovement( STOCK_MOVEMENT.id, @@ -122,12 +127,9 @@ test.describe('Putaway to preferred bin and default bin', () => { internalLocationService, productShowPage, putawayDetailsPage, - productService, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); const internalLocation = await internalLocationService.getLocation(); await test.step('Go to create putaway page', async () => { @@ -220,11 +222,10 @@ test.describe('Putaway to preferred bin and default bin', () => { internalLocation2Service, productShowPage, putawayDetailsPage, - productService, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; - const product2 = await productService.getProduct(Product.FOUR); + const internalLocation = await internalLocationService.getLocation(); const internalLocation2 = await internalLocation2Service.getLocation(); diff --git a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts index 329334f..56efccc 100644 --- a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts +++ b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts @@ -5,16 +5,19 @@ import { ShipmentType } from '@/constants/ShipmentType'; import { expect, test } from '@/fixtures/fixtures'; import { Product } from '@/generated/ProductCodes.generated'; import ProductShowPage from '@/pages/product/productShow/ProductShowPage'; -import { StockMovementResponse } from '@/types'; +import { ProductResponse, StockMovementResponse } from '@/types'; import RefreshCachesUtils from '@/utils/RefreshCaches'; import { deleteReceivedShipment, getShipmentId, getShipmentItemId, } from '@/utils/shipmentUtils'; +import { byNameAsc } from '@/utils/sortUtils'; test.describe('Assert validation on qty removed from receiving bin', () => { let STOCK_MOVEMENT: StockMovementResponse; + let product: ProductResponse; + let product2: ProductResponse; test.beforeEach( async ({ @@ -28,8 +31,10 @@ test.describe('Assert validation on qty removed from receiving bin', () => { originId: supplierLocation.id, }); - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); + [product, product2] = [ + await productService.getProduct(Product.FIVE), + await productService.getProduct(Product.FOUR), + ].sort(byNameAsc); await stockMovementService.addItemsToInboundStockMovement( STOCK_MOVEMENT.id, @@ -99,15 +104,12 @@ test.describe('Assert validation on qty removed from receiving bin', () => { internalLocationService, productShowPage, putawayDetailsPage, - productService, putawayListPage, browser, navbar, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; - const product = await productService.getProduct(Product.FIVE); - const product2 = await productService.getProduct(Product.FOUR); const internalLocation = await internalLocationService.getLocation(); await test.step('Edit transaction date of transfer in', async () => { From 00113ebfdadd63c3c3f2997826b9fd78d1c77dce Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Thu, 18 Jun 2026 15:16:09 +0200 Subject: [PATCH 05/12] improve assert creation of goods receipt note test --- src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts index 83c1614..9d49973 100644 --- a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts +++ b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts @@ -122,6 +122,8 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { await test.step('Assert Goods receipt note is created and opened for partially received shipment', async () => { await stockMovementShowPage.documentTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.documentsListTable .row(7) From aeb2f13d39736ff13732a6821333f1b3456bd586 Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Mon, 22 Jun 2026 09:26:13 +0200 Subject: [PATCH 06/12] fix issue with loading tabs in receiving and putaway tests --- ...rtReceivingBinsOnCreatePutawayPage.test.ts | 7 ++++++ ...eateMoreThan1PutawayForTheSameItem.test.ts | 9 +++++++ src/tests/putaway/createPutaway.test.ts | 5 ++++ .../putaway/deleteItemsFromPutaway.test.ts | 25 +++++++++++++++++++ .../putaway/putawayImtemWithEmptyLot.test.ts | 9 +++++++ .../putaway/putawayMoreThan1Item.test.ts | 8 ++++++ src/tests/putaway/putawayToHoldBin.test.ts | 5 ++++ .../putaway/putawayToPreferredBin.test.ts | 10 ++++++++ src/tests/putaway/splitLineInPutaway.test.ts | 10 ++++++++ ...dationOnQtyRemovedFromReceivingBin.test.ts | 2 ++ .../assertCreationOfGoodsReceiptNote.test.ts | 4 +++ .../receiving/cancelRemainingQty.test.ts | 19 ++++++++++++++ .../editBinLocationWhenReceive.test.ts | 13 ++++++++++ .../receiving/editOriginalLineQtyTo0.test.ts | 5 ++++ ...eInboundWithoutPickAndPutawayStock.test.ts | 3 +++ src/tests/receiving/receiveToHoldBin.test.ts | 5 ++++ .../receiving/receivingStatusChanges.test.ts | 23 +++++++++++++++++ ...atusChangesWithoutPartialReceiving.test.ts | 22 ++++++++++++++++ .../receiving/rollbackStatusChanges.test.ts | 17 +++++++++++++ ...ByAlphabeticalOrderAndRemainInputs.test.ts | 2 ++ 20 files changed, 203 insertions(+) diff --git a/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts b/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts index 2291011..43c56f2 100644 --- a/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts +++ b/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts @@ -161,6 +161,7 @@ test.describe('Assert receiving bin on create putaway page', () => { mainLocationService, internalLocationService, putawayDetailsPage, + page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + PRIMARY_STOCK_MOVEMENT.identifier; @@ -214,6 +215,8 @@ test.describe('Assert receiving bin on create putaway page', () => { await test.step('Assert receiving bins and lot and exp on stockcard', async () => { await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -249,6 +252,8 @@ test.describe('Assert receiving bin on create putaway page', () => { await test.step('Assert receiving bins and lot and exp on stockcard after stock transfer', async () => { await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -336,6 +341,8 @@ test.describe('Assert receiving bin on create putaway page', () => { await test.step('Assert bins and lot on stockcard after putaway', async () => { await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation diff --git a/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts b/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts index 5c12687..d1ca6ab 100644 --- a/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts +++ b/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts @@ -90,6 +90,7 @@ test.describe('Create more than 1 putaway from the same item', () => { productShowPage, putawayDetailsPage, productService, + page, }) => { const product = await productService.getProduct(Product.FIVE); const internalLocation = await internalLocationService.getLocation(); @@ -164,8 +165,12 @@ test.describe('Create more than 1 putaway from the same item', () => { await test.step('Assert putaway bin and qty on stock card', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -218,8 +223,12 @@ test.describe('Create more than 1 putaway from the same item', () => { await test.step('Assert putaway bin and qty on stock card', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation diff --git a/src/tests/putaway/createPutaway.test.ts b/src/tests/putaway/createPutaway.test.ts index 97c1218..6f55efd 100644 --- a/src/tests/putaway/createPutaway.test.ts +++ b/src/tests/putaway/createPutaway.test.ts @@ -90,6 +90,7 @@ test.describe('Putaway received inbound shipment', () => { productShowPage, putawayDetailsPage, productService, + page, }) => { await test.step('Go to stock movement show page and assert received status', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -134,9 +135,13 @@ test.describe('Putaway received inbound shipment', () => { await test.step('Assert putaway bin on stock card', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); const product = await productService.getProduct(Product.FIVE); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); const internalLocation = await internalLocationService.getLocation(); await expect( diff --git a/src/tests/putaway/deleteItemsFromPutaway.test.ts b/src/tests/putaway/deleteItemsFromPutaway.test.ts index 66caff9..68bfbbd 100644 --- a/src/tests/putaway/deleteItemsFromPutaway.test.ts +++ b/src/tests/putaway/deleteItemsFromPutaway.test.ts @@ -99,6 +99,7 @@ test.describe('Delete items from putaway', () => { internalLocationService, putawayDetailsPage, putawayListPage, + page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -145,6 +146,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on summary tab', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect(putawayDetailsPage.summaryTable.orderItemRows).toHaveCount( 2 ); @@ -152,6 +155,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on status table', async () => { await putawayDetailsPage.itemStatusTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemStatusTable.orderItemRows ).toHaveCount(2); @@ -159,6 +164,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on item details table', async () => { await putawayDetailsPage.itemDetailsTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemDetailsTable.orderItemRows ).toHaveCount(2); @@ -192,6 +199,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on summary tab', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect(putawayDetailsPage.summaryTable.orderItemRows).toHaveCount( 1 ); @@ -199,6 +208,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemStatusTable.orderItemRows ).toHaveCount(1); @@ -206,6 +217,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on item details table', async () => { await putawayDetailsPage.itemDetailsTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemDetailsTable.orderItemRows ).toHaveCount(1); @@ -270,6 +283,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on summary tab', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect(putawayDetailsPage.summaryTable.orderItemRows).toHaveCount( 2 ); @@ -277,6 +292,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemStatusTable.orderItemRows ).toHaveCount(2); @@ -284,6 +301,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on item details table', async () => { await putawayDetailsPage.itemDetailsTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemDetailsTable.orderItemRows ).toHaveCount(2); @@ -320,6 +339,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on summary tab on completed putaway', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect(putawayDetailsPage.summaryTable.orderItemRows).toHaveCount( 2 ); @@ -327,6 +348,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on items status table on completed putaway', async () => { await putawayDetailsPage.itemStatusTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemStatusTable.orderItemRows ).toHaveCount(2); @@ -334,6 +357,8 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on item details table on completed putaway', async () => { await putawayDetailsPage.itemDetailsTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemDetailsTable.orderItemRows ).toHaveCount(2); diff --git a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts index 5f8dd07..8e56371 100644 --- a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts +++ b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts @@ -89,6 +89,7 @@ test.describe('Putaway item with empty lot', () => { productShowPage, putawayDetailsPage, productService, + page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -100,6 +101,8 @@ test.describe('Putaway item with empty lot', () => { await test.step('Go to stockcard', async () => { await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); }); @@ -130,6 +133,8 @@ test.describe('Putaway item with empty lot', () => { ); await productShowPage.inStockTabSection.stockTransferDialog.transferStockButton.click(); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -203,8 +208,12 @@ test.describe('Putaway item with empty lot', () => { await test.step('Assert putaway bin on stock card', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation diff --git a/src/tests/putaway/putawayMoreThan1Item.test.ts b/src/tests/putaway/putawayMoreThan1Item.test.ts index 512892d..4b813d9 100644 --- a/src/tests/putaway/putawayMoreThan1Item.test.ts +++ b/src/tests/putaway/putawayMoreThan1Item.test.ts @@ -100,6 +100,7 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { productShowPage, putawayDetailsPage, putawayListPage, + page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -229,6 +230,8 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { await test.step('Assert putaway bin on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation @@ -334,6 +337,7 @@ test.describe('Putaway 2 items in the same putaway', () => { productShowPage, putawayDetailsPage, productService, + page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -400,6 +404,8 @@ test.describe('Putaway 2 items in the same putaway', () => { await test.step('Assert putaway bin on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( @@ -407,6 +413,8 @@ test.describe('Putaway 2 items in the same putaway', () => { ).toHaveText(internalLocation.name); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( diff --git a/src/tests/putaway/putawayToHoldBin.test.ts b/src/tests/putaway/putawayToHoldBin.test.ts index 993cde4..0ca7ea5 100644 --- a/src/tests/putaway/putawayToHoldBin.test.ts +++ b/src/tests/putaway/putawayToHoldBin.test.ts @@ -133,6 +133,7 @@ test.describe('Putaway item into hold bin', () => { navbar, productShowPage, productService, + page, }) => { await test.step('Go to stock movement show page and assert received status', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -176,9 +177,13 @@ test.describe('Putaway item into hold bin', () => { await test.step('Assert putaway bin on stock card', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); const product = await productService.getProduct(Product.FIVE); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation diff --git a/src/tests/putaway/putawayToPreferredBin.test.ts b/src/tests/putaway/putawayToPreferredBin.test.ts index b979b0b..8032a81 100644 --- a/src/tests/putaway/putawayToPreferredBin.test.ts +++ b/src/tests/putaway/putawayToPreferredBin.test.ts @@ -127,6 +127,7 @@ test.describe('Putaway to preferred bin and default bin', () => { internalLocationService, productShowPage, putawayDetailsPage, + page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -201,12 +202,16 @@ test.describe('Putaway to preferred bin and default bin', () => { await test.step('Assert putaway bin on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation ).toHaveText(internalLocation.name); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).defaultBinLocation @@ -222,6 +227,7 @@ test.describe('Putaway to preferred bin and default bin', () => { internalLocation2Service, productShowPage, putawayDetailsPage, + page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -283,6 +289,8 @@ test.describe('Putaway to preferred bin and default bin', () => { await test.step('Assert content of items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemStatusTable.row(1).itemStatus ).toHaveText('COMPLETED'); @@ -297,6 +305,8 @@ test.describe('Putaway to preferred bin and default bin', () => { await test.step('Assert putaway bin on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation diff --git a/src/tests/putaway/splitLineInPutaway.test.ts b/src/tests/putaway/splitLineInPutaway.test.ts index cb2bf28..87e55f0 100644 --- a/src/tests/putaway/splitLineInPutaway.test.ts +++ b/src/tests/putaway/splitLineInPutaway.test.ts @@ -94,6 +94,7 @@ test.describe('Split line in Putaway', () => { putawayDetailsPage, productShowPage, productService, + page, }) => { const internalLocation = await internalLocationService.getLocation(); const internalLocation2 = await internalLocation2Service.getLocation(); @@ -160,6 +161,8 @@ test.describe('Split line in Putaway', () => { await test.step('Assert content of items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemStatusTable.row(1).itemStatus ).toHaveText('COMPLETED'); @@ -182,9 +185,13 @@ test.describe('Split line in Putaway', () => { await test.step('Assert putaway bin on stock card', async () => { await putawayDetailsPage.summaryTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); const product = await productService.getProduct(Product.FIVE); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -202,6 +209,7 @@ test.describe('Split line in Putaway', () => { internalLocationService, internalLocation2Service, putawayDetailsPage, + page, }) => { const internalLocation = await internalLocationService.getLocation(); const internalLocation2 = await internalLocation2Service.getLocation(); @@ -330,6 +338,8 @@ test.describe('Split line in Putaway', () => { await test.step('Assert content of items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemStatusTable.row(1).itemStatus ).toHaveText('COMPLETED'); diff --git a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts index 56efccc..e63db12 100644 --- a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts +++ b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts @@ -268,6 +268,8 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await test.step('Assert putaway bin and qty on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation diff --git a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts index 9d49973..ca600a8 100644 --- a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts +++ b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts @@ -83,6 +83,8 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { await test.step('Go to Documnents tab and assert Goods receipt note is not visible', async () => { await stockMovementShowPage.documentTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.documentsListTable .row(7) @@ -161,6 +163,8 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { await test.step('Assert Goods receipt note is created and opened for received shipment', async () => { await stockMovementShowPage.documentTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.documentsListTable .row(7) diff --git a/src/tests/receiving/cancelRemainingQty.test.ts b/src/tests/receiving/cancelRemainingQty.test.ts index 7818cb1..3b37a4a 100644 --- a/src/tests/receiving/cancelRemainingQty.test.ts +++ b/src/tests/receiving/cancelRemainingQty.test.ts @@ -73,6 +73,7 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Cancel remaining qty when receive item partially', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -125,6 +126,8 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.receiptListTable.row(1).quantityCanceled ).toHaveText('50'); @@ -143,6 +146,7 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Cancel remaining qty when receive items in 2nd receipt', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -177,6 +181,8 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.receiptListTable.row(1).quantityReceived ).toHaveText('50'); @@ -234,6 +240,8 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.receiptListTable.row(2).quantityCanceled ).toHaveText('10'); @@ -257,6 +265,7 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Assert remaining qty and disabled cancel remaining checkbox when receive qty bigger than shipped', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -303,6 +312,8 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled and received qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.receiptListTable.row(1).quantityCanceled ).toHaveText('0'); @@ -321,6 +332,7 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Cancel remaining qty using cancel all remaining button', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -374,6 +386,8 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.receiptListTable.row(1).quantityCanceled ).toHaveText('50'); @@ -392,6 +406,7 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Assert cancel checkbox selection when going forward and backward', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -438,6 +453,8 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled and received qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.packingListTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).quantityShipped ).toHaveText('100'); @@ -486,6 +503,8 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled and received qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.packingListTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(2).quantityShipped ).toHaveText('10'); diff --git a/src/tests/receiving/editBinLocationWhenReceive.test.ts b/src/tests/receiving/editBinLocationWhenReceive.test.ts index 552a78b..3ef71c9 100644 --- a/src/tests/receiving/editBinLocationWhenReceive.test.ts +++ b/src/tests/receiving/editBinLocationWhenReceive.test.ts @@ -128,6 +128,7 @@ test.describe('Edit Bin Location when receive inbound stock movement', () => { stockMovementShowPage, receivingPage, productShowPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -163,6 +164,8 @@ test.describe('Edit Bin Location when receive inbound stock movement', () => { }); await test.step('Assert edited bin on Packing list', async () => { + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText(binLocationName); @@ -171,6 +174,8 @@ test.describe('Edit Bin Location when receive inbound stock movement', () => { await test.step('Go to product page and assert bin location', async () => { await stockMovementShowPage.packingListTable.row(1).product.click(); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation @@ -341,6 +346,7 @@ test.describe('Edit Bin Location to bin with zone when receive inbound stock mov stockMovementShowPage, receivingPage, productShowPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -384,6 +390,8 @@ test.describe('Edit Bin Location to bin with zone when receive inbound stock mov }); await test.step('Assert edited bin on Packing list', async () => { + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText(binLocationName); @@ -392,6 +400,8 @@ test.describe('Edit Bin Location to bin with zone when receive inbound stock mov await test.step('Go to product page and assert bin location', async () => { await stockMovementShowPage.packingListTable.row(1).product.click(); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).zoneLocation @@ -522,6 +532,7 @@ test.describe('Edit Bin Location when receive for all lines', () => { test('Edit Bin location when receive for all lines', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -567,6 +578,8 @@ test.describe('Edit Bin Location when receive for all lines', () => { }); await test.step('Assert edited bin on Packing list', async () => { + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText(binLocationName); diff --git a/src/tests/receiving/editOriginalLineQtyTo0.test.ts b/src/tests/receiving/editOriginalLineQtyTo0.test.ts index ee60c4c..3fd76a0 100644 --- a/src/tests/receiving/editOriginalLineQtyTo0.test.ts +++ b/src/tests/receiving/editOriginalLineQtyTo0.test.ts @@ -285,6 +285,7 @@ test.describe('Edit original line to other product in the middle of receipt', () stockMovementShowPage, receivingPage, productService, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -377,10 +378,14 @@ test.describe('Edit original line to other product in the middle of receipt', () const PRODUCT_FOUR = await productService.getProduct(Product.FOUR); const PRODUCT_FIVE = await productService.getProduct(Product.FIVE); await stockMovementShowPage.packingListTab.isVisible(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).product ).toHaveText(PRODUCT_FOUR.name); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.receiptListTable.row(1).product ).toHaveText(PRODUCT_FIVE.name); diff --git a/src/tests/receiving/receiveInboundWithoutPickAndPutawayStock.test.ts b/src/tests/receiving/receiveInboundWithoutPickAndPutawayStock.test.ts index da8106a..9c3782e 100644 --- a/src/tests/receiving/receiveInboundWithoutPickAndPutawayStock.test.ts +++ b/src/tests/receiving/receiveInboundWithoutPickAndPutawayStock.test.ts @@ -64,6 +64,7 @@ test.describe('Receive inbound stock movement in location without pick and putaw stockMovementShowPage, receivingPage, authService, + page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation( @@ -148,6 +149,8 @@ test.describe('Receive inbound stock movement in location without pick and putaw }); await test.step('Assert Default bin on Packing list', async () => { + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText('Default'); diff --git a/src/tests/receiving/receiveToHoldBin.test.ts b/src/tests/receiving/receiveToHoldBin.test.ts index 35cf2d3..4932f6c 100644 --- a/src/tests/receiving/receiveToHoldBin.test.ts +++ b/src/tests/receiving/receiveToHoldBin.test.ts @@ -96,6 +96,7 @@ test.describe('Receive item into hold bin', () => { stockMovementShowPage, receivingPage, productShowPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -131,6 +132,8 @@ test.describe('Receive item into hold bin', () => { }); await test.step('Assert edited bin on Packing list', async () => { + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText(holdBinLocationName); @@ -139,6 +142,8 @@ test.describe('Receive item into hold bin', () => { await test.step('Go to product page and assert bin location', async () => { await stockMovementShowPage.packingListTable.row(1).product.click(); await productShowPage.inStockTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation diff --git a/src/tests/receiving/receivingStatusChanges.test.ts b/src/tests/receiving/receivingStatusChanges.test.ts index fe673df..e21b529 100644 --- a/src/tests/receiving/receivingStatusChanges.test.ts +++ b/src/tests/receiving/receivingStatusChanges.test.ts @@ -77,6 +77,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { stockMovementShowPage, receivingPage, browser, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -89,6 +90,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -117,6 +120,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await newStockMovementShowPage.isLoaded(); await expect(newStockMovementShowPage.statusTag).toHaveText('Shipped'); await newStockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await newStockMovementShowPage.receiptTab.isVisible(); await expect( newStockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -139,6 +144,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert statuses on stock movmenent show page after receiving item partially', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -156,6 +163,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { stockMovementShowPage, receivingPage, browser, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -168,6 +176,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -196,6 +206,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await newStockMovementShowPage.isLoaded(); await expect(newStockMovementShowPage.statusTag).toHaveText('Shipped'); await newStockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await newStockMovementShowPage.receiptTab.isVisible(); await expect( newStockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -218,6 +230,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert statuses on stock movmenent show page after receiving fully 1 of items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -235,6 +249,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { stockMovementShowPage, receivingPage, browser, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -247,6 +262,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -278,6 +295,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await newStockMovementShowPage.isLoaded(); await expect(newStockMovementShowPage.statusTag).toHaveText('Shipped'); await newStockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await newStockMovementShowPage.receiptTab.isVisible(); await expect( newStockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -309,6 +328,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert statuses on stock movmenent show page after receiving items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -352,6 +373,8 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert statuses on stock movmenent show page after receiving items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(3).receiptStatus diff --git a/src/tests/receiving/receivingStatusChangesWithoutPartialReceiving.test.ts b/src/tests/receiving/receivingStatusChangesWithoutPartialReceiving.test.ts index 8959789..b726217 100644 --- a/src/tests/receiving/receivingStatusChangesWithoutPartialReceiving.test.ts +++ b/src/tests/receiving/receivingStatusChangesWithoutPartialReceiving.test.ts @@ -69,6 +69,7 @@ test.describe('Status changes on sm view page when receive shipment in location stockMovementShowPage, receivingPage, authService, + page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation(AppConfig.instance.locations.depot.id); @@ -82,6 +83,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -115,6 +118,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert Qty and statuses on receipt tab after receiving item partially and cancel not received qty', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -147,6 +152,7 @@ test.describe('Status changes on sm view page when receive shipment in location stockMovementShowPage, receivingPage, authService, + page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation(AppConfig.instance.locations.depot.id); @@ -160,6 +166,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -193,6 +201,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert Qty and statuses on receipt tab after receiving item partially and cancel not received qty', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -225,6 +235,7 @@ test.describe('Status changes on sm view page when receive shipment in location stockMovementShowPage, receivingPage, authService, + page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation(AppConfig.instance.locations.depot.id); @@ -238,6 +249,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -270,6 +283,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert Qty and statuses on receipt tab after receiving items and cancel not received qty', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -302,6 +317,7 @@ test.describe('Status changes on sm view page when receive shipment in location stockMovementShowPage, receivingPage, authService, + page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation(AppConfig.instance.locations.depot.id); @@ -315,6 +331,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -347,6 +365,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert Qty and statuses on receipt tab after receiving items and cancel not received qty', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -385,6 +405,8 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab after rollback receipt', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); diff --git a/src/tests/receiving/rollbackStatusChanges.test.ts b/src/tests/receiving/rollbackStatusChanges.test.ts index 4215f7a..0cc6100 100644 --- a/src/tests/receiving/rollbackStatusChanges.test.ts +++ b/src/tests/receiving/rollbackStatusChanges.test.ts @@ -77,6 +77,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { test('Assert status changes on view page and receipt tab when rollback partial receipt of 1 item', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -106,6 +107,8 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert statuses on stock movmenent show page after receiving item partially', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -128,6 +131,8 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert empty receipt tab after rollback last receipt', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -136,6 +141,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { test('Assert status changes on view page and receipt tab when receive 1 item fully', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -165,6 +171,8 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert statuses on stock movmenent show page after receiving fully 1 of items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -187,6 +195,8 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert empty receipt tab after rollback last receipt', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -195,6 +205,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { test('Assert status changes on view page and receipt tab when receive 1 item fully and 1 partially', async ({ stockMovementShowPage, receivingPage, + page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -246,6 +257,8 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert statuses on stock movmenent show page after receiving items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(3).receiptStatus @@ -266,6 +279,8 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert statuses on stock movmenent show page after receiving items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -298,6 +313,8 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert empty receipt tab after rollback both receipts', async () => { await stockMovementShowPage.receiptTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); diff --git a/src/tests/receiving/sortByAlphabeticalOrderAndRemainInputs.test.ts b/src/tests/receiving/sortByAlphabeticalOrderAndRemainInputs.test.ts index aa3bf3e..c9e5410 100644 --- a/src/tests/receiving/sortByAlphabeticalOrderAndRemainInputs.test.ts +++ b/src/tests/receiving/sortByAlphabeticalOrderAndRemainInputs.test.ts @@ -104,6 +104,8 @@ test.describe('Apply sorting by alphabetical order and remain inputs', () => { await test.step('Send shipment', async () => { await createInboundPage.nextButton.click(); await createInboundPage.sendStep.isLoaded(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); await expect(createInboundPage.sendStep.sendShipmentButton).toBeVisible(); await createInboundPage.sendStep.sendShipmentButton.focus(); await createInboundPage.sendStep.sendShipmentButton.click(); From 46e02c1d0c35b32e768938699472d3326053a551 Mon Sep 17 00:00:00 2001 From: Alan Nadolny Date: Mon, 22 Jun 2026 12:36:24 +0200 Subject: [PATCH 07/12] OBPIH-7785 Fixes for failing tests --- .../sections/components/LineItemsTable.ts | 13 ++++++ .../productShow/tabs/InStockTabSection.ts | 14 +++++++ src/pages/transactions/TransactionListPage.ts | 14 +++++++ ...ssertAttemptToEditCompletedPutaway.test.ts | 8 +--- .../putaway/assertPutawayDetailsPage.test.ts | 8 +--- ...rtReceivingBinsOnCreatePutawayPage.test.ts | 2 +- .../putaway/assertZonesInPutaways.test.ts | 2 +- ...eateMoreThan1PutawayForTheSameItem.test.ts | 24 ++++++----- src/tests/putaway/createPutaway.test.ts | 8 +--- .../putaway/deleteItemsFromPutaway.test.ts | 2 +- .../performPutawayAsManagerUser.test.ts | 4 +- .../putaway/putawayImtemWithEmptyLot.test.ts | 2 +- .../putaway/putawayMoreThan1Item.test.ts | 6 +-- src/tests/putaway/putawayToHoldBin.test.ts | 8 +--- .../putaway/putawayToPreferredBin.test.ts | 4 +- ...lbackLastReceiptWhenPutawayCreated.test.ts | 8 +--- ...ByCurrentPreferredAndOriginalOrder.test.ts | 2 +- src/tests/putaway/splitLineInPutaway.test.ts | 12 ++---- ...dationOnQtyRemovedFromReceivingBin.test.ts | 14 ++++--- .../assertCreationOfGoodsReceiptNote.test.ts | 40 +++++++++++-------- src/utils/shipmentUtils.ts | 12 ++++-- 21 files changed, 121 insertions(+), 86 deletions(-) diff --git a/src/pages/product/productShow/sections/components/LineItemsTable.ts b/src/pages/product/productShow/sections/components/LineItemsTable.ts index 1d0f99a..19019c0 100644 --- a/src/pages/product/productShow/sections/components/LineItemsTable.ts +++ b/src/pages/product/productShow/sections/components/LineItemsTable.ts @@ -38,6 +38,19 @@ class LineItemsTable extends BasePageModel { getRowByLot(lot: string) { return this.table.locator(`tr:has-text("${lot}")`); } + + /** + * Select a row by its bin location name instead of a positional index. + * Residual/negative stock in shared bins can add unexpected rows (see + * validateCleanState.setup.ts), which shifts indices and makes `row(n)` + * target the wrong bin. Matching by name keeps the interaction correct. + */ + getRowByBinLocation(binLocation: string) { + return new Row( + this.page, + this.rows.filter({ hasText: binLocation }).first() + ); + } } class Row extends BasePageModel { diff --git a/src/pages/product/productShow/tabs/InStockTabSection.ts b/src/pages/product/productShow/tabs/InStockTabSection.ts index 9b7ee9a..7cffa40 100644 --- a/src/pages/product/productShow/tabs/InStockTabSection.ts +++ b/src/pages/product/productShow/tabs/InStockTabSection.ts @@ -32,6 +32,20 @@ class InStockTabSection extends BasePageModel { return new Row(this.page, this.rows.nth(index)); } + /** + * Select a row by its bin location name instead of a positional index. + * Residual stock in shared bins can add unexpected rows (see + * validateCleanState.setup.ts), shifting indices so `row(n)` reads the + * wrong bin. Matching by name keeps the assertion pinned to the bin we + * actually put away into. + */ + getRowByBinLocation(binLocation: string) { + return new Row( + this.page, + this.rows.filter({ hasText: binLocation }).first() + ); + } + get stockTransferButton() { return this.page.getByRole('link', { name: 'Transfer Stock' }); } diff --git a/src/pages/transactions/TransactionListPage.ts b/src/pages/transactions/TransactionListPage.ts index 2ae42e0..d403f3b 100644 --- a/src/pages/transactions/TransactionListPage.ts +++ b/src/pages/transactions/TransactionListPage.ts @@ -20,6 +20,20 @@ class TransactionListPage extends BasePageModel { await this.table.deleteButton.click(); await expect(this.page.locator('.message')).toBeVisible(); } + + /** + * Best-effort deletion used during cleanup. After a test fails mid-way the + * expected transactions may be missing, so a hard delete would throw and + * abort the afterEach before the shipment gets removed — leaving a received + * shipment behind. This swallows such errors so cleanup can continue. + */ + async deleteTransactionIfPresent(n: number) { + try { + await this.deleteTransaction(n); + } catch { + // Nothing to delete at this row; continue with the rest of the cleanup. + } + } } export default TransactionListPage; diff --git a/src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts b/src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts index 1ca9b65..5250192 100644 --- a/src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts +++ b/src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts @@ -66,12 +66,8 @@ test.describe('Assert attempt to edit completed putaway', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/assertPutawayDetailsPage.test.ts b/src/tests/putaway/assertPutawayDetailsPage.test.ts index 4188f4e..d702c73 100644 --- a/src/tests/putaway/assertPutawayDetailsPage.test.ts +++ b/src/tests/putaway/assertPutawayDetailsPage.test.ts @@ -74,12 +74,8 @@ test.describe('Assert putaway details page', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts b/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts index 43c56f2..df09af4 100644 --- a/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts +++ b/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts @@ -133,7 +133,7 @@ test.describe('Assert receiving bin on create putaway page', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 4; n++) { - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); } await deleteReceivedShipment({ diff --git a/src/tests/putaway/assertZonesInPutaways.test.ts b/src/tests/putaway/assertZonesInPutaways.test.ts index 1b6e85e..853328b 100644 --- a/src/tests/putaway/assertZonesInPutaways.test.ts +++ b/src/tests/putaway/assertZonesInPutaways.test.ts @@ -158,7 +158,7 @@ test.describe('Assert zones on putaway pages', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 3; n++) { - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); } await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts b/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts index d1ca6ab..865f8a5 100644 --- a/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts +++ b/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts @@ -66,12 +66,8 @@ test.describe('Create more than 1 putaway from the same item', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, @@ -173,10 +169,14 @@ test.describe('Create more than 1 putaway from the same item', () => { await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( - productShowPage.inStockTabSection.row(1).binLocation + productShowPage.inStockTabSection.getRowByBinLocation( + internalLocation.name + ).binLocation ).toHaveText(internalLocation.name); await expect( - productShowPage.inStockTabSection.row(1).quantityOnHand + productShowPage.inStockTabSection.getRowByBinLocation( + internalLocation.name + ).quantityOnHand ).toHaveText('5'); await RefreshCachesUtils.refreshCaches({ navbar, @@ -231,10 +231,14 @@ test.describe('Create more than 1 putaway from the same item', () => { await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( - productShowPage.inStockTabSection.row(1).binLocation + productShowPage.inStockTabSection.getRowByBinLocation( + internalLocation.name + ).binLocation ).toHaveText(internalLocation.name); await expect( - productShowPage.inStockTabSection.row(1).quantityOnHand + productShowPage.inStockTabSection.getRowByBinLocation( + internalLocation.name + ).quantityOnHand ).toHaveText('10'); }); }); diff --git a/src/tests/putaway/createPutaway.test.ts b/src/tests/putaway/createPutaway.test.ts index 6f55efd..fa9dbde 100644 --- a/src/tests/putaway/createPutaway.test.ts +++ b/src/tests/putaway/createPutaway.test.ts @@ -66,12 +66,8 @@ test.describe('Putaway received inbound shipment', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/deleteItemsFromPutaway.test.ts b/src/tests/putaway/deleteItemsFromPutaway.test.ts index 68bfbbd..12dc627 100644 --- a/src/tests/putaway/deleteItemsFromPutaway.test.ts +++ b/src/tests/putaway/deleteItemsFromPutaway.test.ts @@ -81,7 +81,7 @@ test.describe('Delete items from putaway', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 3; n++) { - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); } await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/performPutawayAsManagerUser.test.ts b/src/tests/putaway/performPutawayAsManagerUser.test.ts index 725670a..b13a04a 100644 --- a/src/tests/putaway/performPutawayAsManagerUser.test.ts +++ b/src/tests/putaway/performPutawayAsManagerUser.test.ts @@ -85,8 +85,8 @@ test.describe('Perform putaway as manager user', () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransaction(1); - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, oldViewShipmentPage, diff --git a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts index 8e56371..a7f21d8 100644 --- a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts +++ b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts @@ -67,7 +67,7 @@ test.describe('Putaway item with empty lot', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 7; n++) { - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); } await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/putawayMoreThan1Item.test.ts b/src/tests/putaway/putawayMoreThan1Item.test.ts index 4b813d9..af1bdb9 100644 --- a/src/tests/putaway/putawayMoreThan1Item.test.ts +++ b/src/tests/putaway/putawayMoreThan1Item.test.ts @@ -81,7 +81,7 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 4; n++) { - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); } await deleteReceivedShipment({ stockMovementShowPage, @@ -317,8 +317,8 @@ test.describe('Putaway 2 items in the same putaway', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransaction(1); - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); await stockMovementShowPage.detailsListTable.oldViewShipmentPage.click(); await oldViewShipmentPage.undoStatusChangeButton.click(); diff --git a/src/tests/putaway/putawayToHoldBin.test.ts b/src/tests/putaway/putawayToHoldBin.test.ts index 0ca7ea5..1c2eadc 100644 --- a/src/tests/putaway/putawayToHoldBin.test.ts +++ b/src/tests/putaway/putawayToHoldBin.test.ts @@ -92,12 +92,8 @@ test.describe('Putaway item into hold bin', () => { AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/putawayToPreferredBin.test.ts b/src/tests/putaway/putawayToPreferredBin.test.ts index 8032a81..cf5684d 100644 --- a/src/tests/putaway/putawayToPreferredBin.test.ts +++ b/src/tests/putaway/putawayToPreferredBin.test.ts @@ -98,8 +98,8 @@ test.describe('Putaway to preferred bin and default bin', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransaction(1); - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, oldViewShipmentPage, diff --git a/src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts b/src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts index d6b205d..1fe640d 100644 --- a/src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts +++ b/src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts @@ -66,12 +66,8 @@ test.describe('Rollback last receipt behavior when putaway created', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, oldViewShipmentPage, diff --git a/src/tests/putaway/sortPutawayByCurrentPreferredAndOriginalOrder.test.ts b/src/tests/putaway/sortPutawayByCurrentPreferredAndOriginalOrder.test.ts index 09f4d13..4644fc3 100644 --- a/src/tests/putaway/sortPutawayByCurrentPreferredAndOriginalOrder.test.ts +++ b/src/tests/putaway/sortPutawayByCurrentPreferredAndOriginalOrder.test.ts @@ -103,7 +103,7 @@ test.describe('Sort putaway by current bin, preferred bin and original order', ( await navbar.configurationButton.click(); await navbar.transactions.click(); for (let i = 0; i < 3; i++) { - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); } await deleteReceivedShipment({ diff --git a/src/tests/putaway/splitLineInPutaway.test.ts b/src/tests/putaway/splitLineInPutaway.test.ts index 87e55f0..bc40ad5 100644 --- a/src/tests/putaway/splitLineInPutaway.test.ts +++ b/src/tests/putaway/splitLineInPutaway.test.ts @@ -66,15 +66,9 @@ test.describe('Split line in Putaway', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); - await transactionListPage.table.row(1).actionsButton.click(); - await transactionListPage.table.deleteButton.click(); - await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransactionIfPresent(1); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts index e63db12..32fbe8e 100644 --- a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts +++ b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts @@ -84,7 +84,7 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 4; n++) { - await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransactionIfPresent(1); } await deleteReceivedShipment({ stockMovementShowPage, @@ -179,7 +179,7 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await newProductShowPage.goToPage(product.id); await newProductShowPage.recordStockButton.click(); await newProductShowPage.recordStock.lineItemsTable - .row(1) + .getRowByBinLocation(receivingBin) .newQuantity.getByRole('textbox') .fill('0'); await newProductShowPage.recordStock.lineItemsTable.saveButton.click(); @@ -221,7 +221,7 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await productShowPage.goToPage(product2.id); await productShowPage.recordStockButton.click(); await productShowPage.recordStock.lineItemsTable - .row(2) + .getRowByBinLocation(receivingBin) .newQuantity.getByRole('textbox') .fill('5'); await productShowPage.recordStock.lineItemsTable.saveButton.click(); @@ -272,10 +272,14 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( - productShowPage.inStockTabSection.row(2).binLocation + productShowPage.inStockTabSection.getRowByBinLocation( + internalLocation.name + ).binLocation ).toHaveText(internalLocation.name); await expect( - productShowPage.inStockTabSection.row(2).quantityOnHand + productShowPage.inStockTabSection.getRowByBinLocation( + internalLocation.name + ).quantityOnHand ).toHaveText('5'); }); }); diff --git a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts index ca600a8..a812f56 100644 --- a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts +++ b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts @@ -123,14 +123,19 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { }); await test.step('Assert Goods receipt note is created and opened for partially received shipment', async () => { - await stockMovementShowPage.documentTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); - await expect( - stockMovementShowPage.documentsListTable - .row(7) - .getDocumentName('Goods Receipt Note') - ).toBeVisible(); + // The Goods Receipt Note is attached to the shipment asynchronously after + // the receipt completes, so the show page that loads right after can still + // be missing it. Reload until the document shows up instead of asserting + // once against a possibly stale page. + await expect(async () => { + await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); + await stockMovementShowPage.documentTab.click(); + await expect( + stockMovementShowPage.documentsListTable + .row(7) + .getDocumentName('Goods Receipt Note') + ).toBeVisible({ timeout: 3000 }); + }).toPass({ timeout: 15000 }); const popupPromise = page.waitForEvent('popup'); await stockMovementShowPage.documentsListTable .row(7) @@ -162,14 +167,17 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { }); await test.step('Assert Goods receipt note is created and opened for received shipment', async () => { - await stockMovementShowPage.documentTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); - await expect( - stockMovementShowPage.documentsListTable - .row(7) - .getDocumentName('Goods Receipt Note') - ).toBeVisible(); + // See note above: the GRN is attached asynchronously after the receipt, + // so reload until it appears rather than asserting against a stale page. + await expect(async () => { + await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); + await stockMovementShowPage.documentTab.click(); + await expect( + stockMovementShowPage.documentsListTable + .row(7) + .getDocumentName('Goods Receipt Note') + ).toBeVisible({ timeout: 3000 }); + }).toPass({ timeout: 15000 }); const popupPromise = page.waitForEvent('popup'); await stockMovementShowPage.documentsListTable .row(7) diff --git a/src/utils/shipmentUtils.ts b/src/utils/shipmentUtils.ts index abdd873..480d735 100644 --- a/src/utils/shipmentUtils.ts +++ b/src/utils/shipmentUtils.ts @@ -71,9 +71,13 @@ export async function deleteReceivedShipment({ oldViewShipmentPage: OldViewShipmentPage; }) { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); - await stockMovementShowPage.detailsListTable.oldViewShipmentPage.click(); - await oldViewShipmentPage.undoStatusChangeButton.click(); - await stockMovementShowPage.isLoaded(); - await stockMovementShowPage.rollbackButton.click(); + try { + await stockMovementShowPage.detailsListTable.oldViewShipmentPage.click(); + await oldViewShipmentPage.undoStatusChangeButton.click(); + await stockMovementShowPage.isLoaded(); + await stockMovementShowPage.rollbackButton.click(); + } catch { + /* empty */ + } await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id); } From acd612c50149f4cae79cfd8e60a17da8a54cca8e Mon Sep 17 00:00:00 2001 From: Alan Nadolny Date: Tue, 23 Jun 2026 12:26:20 +0200 Subject: [PATCH 08/12] Revert "OBPIH-7785 Fixes for failing tests" This reverts commit 46e02c1d0c35b32e768938699472d3326053a551. --- .../sections/components/LineItemsTable.ts | 13 ------ .../productShow/tabs/InStockTabSection.ts | 14 ------- src/pages/transactions/TransactionListPage.ts | 14 ------- ...ssertAttemptToEditCompletedPutaway.test.ts | 8 +++- .../putaway/assertPutawayDetailsPage.test.ts | 8 +++- ...rtReceivingBinsOnCreatePutawayPage.test.ts | 2 +- .../putaway/assertZonesInPutaways.test.ts | 2 +- ...eateMoreThan1PutawayForTheSameItem.test.ts | 24 +++++------ src/tests/putaway/createPutaway.test.ts | 8 +++- .../putaway/deleteItemsFromPutaway.test.ts | 2 +- .../performPutawayAsManagerUser.test.ts | 4 +- .../putaway/putawayImtemWithEmptyLot.test.ts | 2 +- .../putaway/putawayMoreThan1Item.test.ts | 6 +-- src/tests/putaway/putawayToHoldBin.test.ts | 8 +++- .../putaway/putawayToPreferredBin.test.ts | 4 +- ...lbackLastReceiptWhenPutawayCreated.test.ts | 8 +++- ...ByCurrentPreferredAndOriginalOrder.test.ts | 2 +- src/tests/putaway/splitLineInPutaway.test.ts | 12 ++++-- ...dationOnQtyRemovedFromReceivingBin.test.ts | 14 +++---- .../assertCreationOfGoodsReceiptNote.test.ts | 40 ++++++++----------- src/utils/shipmentUtils.ts | 12 ++---- 21 files changed, 86 insertions(+), 121 deletions(-) diff --git a/src/pages/product/productShow/sections/components/LineItemsTable.ts b/src/pages/product/productShow/sections/components/LineItemsTable.ts index 19019c0..1d0f99a 100644 --- a/src/pages/product/productShow/sections/components/LineItemsTable.ts +++ b/src/pages/product/productShow/sections/components/LineItemsTable.ts @@ -38,19 +38,6 @@ class LineItemsTable extends BasePageModel { getRowByLot(lot: string) { return this.table.locator(`tr:has-text("${lot}")`); } - - /** - * Select a row by its bin location name instead of a positional index. - * Residual/negative stock in shared bins can add unexpected rows (see - * validateCleanState.setup.ts), which shifts indices and makes `row(n)` - * target the wrong bin. Matching by name keeps the interaction correct. - */ - getRowByBinLocation(binLocation: string) { - return new Row( - this.page, - this.rows.filter({ hasText: binLocation }).first() - ); - } } class Row extends BasePageModel { diff --git a/src/pages/product/productShow/tabs/InStockTabSection.ts b/src/pages/product/productShow/tabs/InStockTabSection.ts index 7cffa40..9b7ee9a 100644 --- a/src/pages/product/productShow/tabs/InStockTabSection.ts +++ b/src/pages/product/productShow/tabs/InStockTabSection.ts @@ -32,20 +32,6 @@ class InStockTabSection extends BasePageModel { return new Row(this.page, this.rows.nth(index)); } - /** - * Select a row by its bin location name instead of a positional index. - * Residual stock in shared bins can add unexpected rows (see - * validateCleanState.setup.ts), shifting indices so `row(n)` reads the - * wrong bin. Matching by name keeps the assertion pinned to the bin we - * actually put away into. - */ - getRowByBinLocation(binLocation: string) { - return new Row( - this.page, - this.rows.filter({ hasText: binLocation }).first() - ); - } - get stockTransferButton() { return this.page.getByRole('link', { name: 'Transfer Stock' }); } diff --git a/src/pages/transactions/TransactionListPage.ts b/src/pages/transactions/TransactionListPage.ts index d403f3b..2ae42e0 100644 --- a/src/pages/transactions/TransactionListPage.ts +++ b/src/pages/transactions/TransactionListPage.ts @@ -20,20 +20,6 @@ class TransactionListPage extends BasePageModel { await this.table.deleteButton.click(); await expect(this.page.locator('.message')).toBeVisible(); } - - /** - * Best-effort deletion used during cleanup. After a test fails mid-way the - * expected transactions may be missing, so a hard delete would throw and - * abort the afterEach before the shipment gets removed — leaving a received - * shipment behind. This swallows such errors so cleanup can continue. - */ - async deleteTransactionIfPresent(n: number) { - try { - await this.deleteTransaction(n); - } catch { - // Nothing to delete at this row; continue with the rest of the cleanup. - } - } } export default TransactionListPage; diff --git a/src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts b/src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts index 5250192..1ca9b65 100644 --- a/src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts +++ b/src/tests/putaway/assertAttemptToEditCompletedPutaway.test.ts @@ -66,8 +66,12 @@ test.describe('Assert attempt to edit completed putaway', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/assertPutawayDetailsPage.test.ts b/src/tests/putaway/assertPutawayDetailsPage.test.ts index d702c73..4188f4e 100644 --- a/src/tests/putaway/assertPutawayDetailsPage.test.ts +++ b/src/tests/putaway/assertPutawayDetailsPage.test.ts @@ -74,8 +74,12 @@ test.describe('Assert putaway details page', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts b/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts index df09af4..43c56f2 100644 --- a/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts +++ b/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts @@ -133,7 +133,7 @@ test.describe('Assert receiving bin on create putaway page', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 4; n++) { - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ diff --git a/src/tests/putaway/assertZonesInPutaways.test.ts b/src/tests/putaway/assertZonesInPutaways.test.ts index 853328b..1b6e85e 100644 --- a/src/tests/putaway/assertZonesInPutaways.test.ts +++ b/src/tests/putaway/assertZonesInPutaways.test.ts @@ -158,7 +158,7 @@ test.describe('Assert zones on putaway pages', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 3; n++) { - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts b/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts index 865f8a5..d1ca6ab 100644 --- a/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts +++ b/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts @@ -66,8 +66,12 @@ test.describe('Create more than 1 putaway from the same item', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); await deleteReceivedShipment({ stockMovementShowPage, @@ -169,14 +173,10 @@ test.describe('Create more than 1 putaway from the same item', () => { await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( - productShowPage.inStockTabSection.getRowByBinLocation( - internalLocation.name - ).binLocation + productShowPage.inStockTabSection.row(1).binLocation ).toHaveText(internalLocation.name); await expect( - productShowPage.inStockTabSection.getRowByBinLocation( - internalLocation.name - ).quantityOnHand + productShowPage.inStockTabSection.row(1).quantityOnHand ).toHaveText('5'); await RefreshCachesUtils.refreshCaches({ navbar, @@ -231,14 +231,10 @@ test.describe('Create more than 1 putaway from the same item', () => { await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( - productShowPage.inStockTabSection.getRowByBinLocation( - internalLocation.name - ).binLocation + productShowPage.inStockTabSection.row(1).binLocation ).toHaveText(internalLocation.name); await expect( - productShowPage.inStockTabSection.getRowByBinLocation( - internalLocation.name - ).quantityOnHand + productShowPage.inStockTabSection.row(1).quantityOnHand ).toHaveText('10'); }); }); diff --git a/src/tests/putaway/createPutaway.test.ts b/src/tests/putaway/createPutaway.test.ts index fa9dbde..6f55efd 100644 --- a/src/tests/putaway/createPutaway.test.ts +++ b/src/tests/putaway/createPutaway.test.ts @@ -66,8 +66,12 @@ test.describe('Putaway received inbound shipment', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/deleteItemsFromPutaway.test.ts b/src/tests/putaway/deleteItemsFromPutaway.test.ts index 12dc627..68bfbbd 100644 --- a/src/tests/putaway/deleteItemsFromPutaway.test.ts +++ b/src/tests/putaway/deleteItemsFromPutaway.test.ts @@ -81,7 +81,7 @@ test.describe('Delete items from putaway', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 3; n++) { - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/performPutawayAsManagerUser.test.ts b/src/tests/putaway/performPutawayAsManagerUser.test.ts index b13a04a..725670a 100644 --- a/src/tests/putaway/performPutawayAsManagerUser.test.ts +++ b/src/tests/putaway/performPutawayAsManagerUser.test.ts @@ -85,8 +85,8 @@ test.describe('Perform putaway as manager user', () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransaction(1); await deleteReceivedShipment({ stockMovementShowPage, oldViewShipmentPage, diff --git a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts index a7f21d8..8e56371 100644 --- a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts +++ b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts @@ -67,7 +67,7 @@ test.describe('Putaway item with empty lot', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 7; n++) { - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/putawayMoreThan1Item.test.ts b/src/tests/putaway/putawayMoreThan1Item.test.ts index af1bdb9..4b813d9 100644 --- a/src/tests/putaway/putawayMoreThan1Item.test.ts +++ b/src/tests/putaway/putawayMoreThan1Item.test.ts @@ -81,7 +81,7 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 4; n++) { - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ stockMovementShowPage, @@ -317,8 +317,8 @@ test.describe('Putaway 2 items in the same putaway', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransaction(1); await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); await stockMovementShowPage.detailsListTable.oldViewShipmentPage.click(); await oldViewShipmentPage.undoStatusChangeButton.click(); diff --git a/src/tests/putaway/putawayToHoldBin.test.ts b/src/tests/putaway/putawayToHoldBin.test.ts index 1c2eadc..0ca7ea5 100644 --- a/src/tests/putaway/putawayToHoldBin.test.ts +++ b/src/tests/putaway/putawayToHoldBin.test.ts @@ -92,8 +92,12 @@ test.describe('Putaway item into hold bin', () => { AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/putawayToPreferredBin.test.ts b/src/tests/putaway/putawayToPreferredBin.test.ts index cf5684d..8032a81 100644 --- a/src/tests/putaway/putawayToPreferredBin.test.ts +++ b/src/tests/putaway/putawayToPreferredBin.test.ts @@ -98,8 +98,8 @@ test.describe('Putaway to preferred bin and default bin', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); + await transactionListPage.deleteTransaction(1); await deleteReceivedShipment({ stockMovementShowPage, oldViewShipmentPage, diff --git a/src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts b/src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts index 1fe640d..d6b205d 100644 --- a/src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts +++ b/src/tests/putaway/rollbackLastReceiptWhenPutawayCreated.test.ts @@ -66,8 +66,12 @@ test.describe('Rollback last receipt behavior when putaway created', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); await deleteReceivedShipment({ stockMovementShowPage, oldViewShipmentPage, diff --git a/src/tests/putaway/sortPutawayByCurrentPreferredAndOriginalOrder.test.ts b/src/tests/putaway/sortPutawayByCurrentPreferredAndOriginalOrder.test.ts index 4644fc3..09f4d13 100644 --- a/src/tests/putaway/sortPutawayByCurrentPreferredAndOriginalOrder.test.ts +++ b/src/tests/putaway/sortPutawayByCurrentPreferredAndOriginalOrder.test.ts @@ -103,7 +103,7 @@ test.describe('Sort putaway by current bin, preferred bin and original order', ( await navbar.configurationButton.click(); await navbar.transactions.click(); for (let i = 0; i < 3; i++) { - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ diff --git a/src/tests/putaway/splitLineInPutaway.test.ts b/src/tests/putaway/splitLineInPutaway.test.ts index bc40ad5..87e55f0 100644 --- a/src/tests/putaway/splitLineInPutaway.test.ts +++ b/src/tests/putaway/splitLineInPutaway.test.ts @@ -66,9 +66,15 @@ test.describe('Split line in Putaway', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); + await transactionListPage.table.row(1).actionsButton.click(); + await transactionListPage.table.deleteButton.click(); + await expect(transactionListPage.successMessage).toBeVisible(); await deleteReceivedShipment({ stockMovementShowPage, diff --git a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts index 32fbe8e..e63db12 100644 --- a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts +++ b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts @@ -84,7 +84,7 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await navbar.configurationButton.click(); await navbar.transactions.click(); for (let n = 1; n < 4; n++) { - await transactionListPage.deleteTransactionIfPresent(1); + await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ stockMovementShowPage, @@ -179,7 +179,7 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await newProductShowPage.goToPage(product.id); await newProductShowPage.recordStockButton.click(); await newProductShowPage.recordStock.lineItemsTable - .getRowByBinLocation(receivingBin) + .row(1) .newQuantity.getByRole('textbox') .fill('0'); await newProductShowPage.recordStock.lineItemsTable.saveButton.click(); @@ -221,7 +221,7 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await productShowPage.goToPage(product2.id); await productShowPage.recordStockButton.click(); await productShowPage.recordStock.lineItemsTable - .getRowByBinLocation(receivingBin) + .row(2) .newQuantity.getByRole('textbox') .fill('5'); await productShowPage.recordStock.lineItemsTable.saveButton.click(); @@ -272,14 +272,10 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( - productShowPage.inStockTabSection.getRowByBinLocation( - internalLocation.name - ).binLocation + productShowPage.inStockTabSection.row(2).binLocation ).toHaveText(internalLocation.name); await expect( - productShowPage.inStockTabSection.getRowByBinLocation( - internalLocation.name - ).quantityOnHand + productShowPage.inStockTabSection.row(2).quantityOnHand ).toHaveText('5'); }); }); diff --git a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts index a812f56..ca600a8 100644 --- a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts +++ b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts @@ -123,19 +123,14 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { }); await test.step('Assert Goods receipt note is created and opened for partially received shipment', async () => { - // The Goods Receipt Note is attached to the shipment asynchronously after - // the receipt completes, so the show page that loads right after can still - // be missing it. Reload until the document shows up instead of asserting - // once against a possibly stale page. - await expect(async () => { - await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); - await stockMovementShowPage.documentTab.click(); - await expect( - stockMovementShowPage.documentsListTable - .row(7) - .getDocumentName('Goods Receipt Note') - ).toBeVisible({ timeout: 3000 }); - }).toPass({ timeout: 15000 }); + await stockMovementShowPage.documentTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); + await expect( + stockMovementShowPage.documentsListTable + .row(7) + .getDocumentName('Goods Receipt Note') + ).toBeVisible(); const popupPromise = page.waitForEvent('popup'); await stockMovementShowPage.documentsListTable .row(7) @@ -167,17 +162,14 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { }); await test.step('Assert Goods receipt note is created and opened for received shipment', async () => { - // See note above: the GRN is attached asynchronously after the receipt, - // so reload until it appears rather than asserting against a stale page. - await expect(async () => { - await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); - await stockMovementShowPage.documentTab.click(); - await expect( - stockMovementShowPage.documentsListTable - .row(7) - .getDocumentName('Goods Receipt Note') - ).toBeVisible({ timeout: 3000 }); - }).toPass({ timeout: 15000 }); + await stockMovementShowPage.documentTab.click(); + // eslint-disable-next-line playwright/no-networkidle + await page.waitForLoadState('networkidle'); + await expect( + stockMovementShowPage.documentsListTable + .row(7) + .getDocumentName('Goods Receipt Note') + ).toBeVisible(); const popupPromise = page.waitForEvent('popup'); await stockMovementShowPage.documentsListTable .row(7) diff --git a/src/utils/shipmentUtils.ts b/src/utils/shipmentUtils.ts index 480d735..abdd873 100644 --- a/src/utils/shipmentUtils.ts +++ b/src/utils/shipmentUtils.ts @@ -71,13 +71,9 @@ export async function deleteReceivedShipment({ oldViewShipmentPage: OldViewShipmentPage; }) { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); - try { - await stockMovementShowPage.detailsListTable.oldViewShipmentPage.click(); - await oldViewShipmentPage.undoStatusChangeButton.click(); - await stockMovementShowPage.isLoaded(); - await stockMovementShowPage.rollbackButton.click(); - } catch { - /* empty */ - } + await stockMovementShowPage.detailsListTable.oldViewShipmentPage.click(); + await oldViewShipmentPage.undoStatusChangeButton.click(); + await stockMovementShowPage.isLoaded(); + await stockMovementShowPage.rollbackButton.click(); await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id); } From 1f3a879c29db04301bffa1d32b7ebf7ff1a74343 Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Tue, 23 Jun 2026 20:12:06 +0200 Subject: [PATCH 09/12] fix after each in test --- src/tests/putaway/assertZonesInPutaways.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/putaway/assertZonesInPutaways.test.ts b/src/tests/putaway/assertZonesInPutaways.test.ts index 1b6e85e..e16464b 100644 --- a/src/tests/putaway/assertZonesInPutaways.test.ts +++ b/src/tests/putaway/assertZonesInPutaways.test.ts @@ -157,7 +157,7 @@ test.describe('Assert zones on putaway pages', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - for (let n = 1; n < 3; n++) { + for (let n = 1; n < 4; n++) { await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ From 45567d6b55eb2786e64ea6b9f0c13bfa4dfbdb9a Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Wed, 24 Jun 2026 13:16:51 +0200 Subject: [PATCH 10/12] fix failing tests --- src/tests/putaway/putawayImtemWithEmptyLot.test.ts | 2 +- .../validationOnQtyRemovedFromReceivingBin.test.ts | 2 +- .../sortByAlphabeticalOrderAndRemainInputs.test.ts | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts index 8e56371..5f0db13 100644 --- a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts +++ b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts @@ -66,7 +66,7 @@ test.describe('Putaway item with empty lot', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - for (let n = 1; n < 7; n++) { + for (let n = 1; n < 5; n++) { await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ diff --git a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts index e63db12..f7f43d9 100644 --- a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts +++ b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts @@ -83,7 +83,7 @@ test.describe('Assert validation on qty removed from receiving bin', () => { }) => { await navbar.configurationButton.click(); await navbar.transactions.click(); - for (let n = 1; n < 4; n++) { + for (let n = 1; n < 6; n++) { await transactionListPage.deleteTransaction(1); } await deleteReceivedShipment({ diff --git a/src/tests/receiving/sortByAlphabeticalOrderAndRemainInputs.test.ts b/src/tests/receiving/sortByAlphabeticalOrderAndRemainInputs.test.ts index c9e5410..5b2b2db 100644 --- a/src/tests/receiving/sortByAlphabeticalOrderAndRemainInputs.test.ts +++ b/src/tests/receiving/sortByAlphabeticalOrderAndRemainInputs.test.ts @@ -104,12 +104,12 @@ test.describe('Apply sorting by alphabetical order and remain inputs', () => { await test.step('Send shipment', async () => { await createInboundPage.nextButton.click(); await createInboundPage.sendStep.isLoaded(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await expect(createInboundPage.sendStep.sendShipmentButton).toBeVisible(); - await createInboundPage.sendStep.sendShipmentButton.focus(); - await createInboundPage.sendStep.sendShipmentButton.click(); - await stockMovementShowPage.waitForUrl(); + await expect(createInboundPage.sendStep.sendShipmentButton).toBeEnabled(); + await Promise.all([ + stockMovementShowPage.waitForUrl(), + createInboundPage.sendStep.sendShipmentButton.click(), + ]); await stockMovementShowPage.isLoaded(); }); From f3e223446733d300f82e0ffc77ffd93c7d0bcc97 Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Wed, 24 Jun 2026 19:41:59 +0200 Subject: [PATCH 11/12] improve asserting if gsp tabs are loaded --- .../components/ItemDetailsTable.ts | 8 +++- .../components/ItemStatusTable.ts | 8 +++- .../putawayDetails/components/SummaryTable.ts | 8 +++- .../components/DocumentsTable.ts | 8 +++- .../components/PackingListTable.ts | 8 +++- .../components/ReceiptsTable.ts | 8 +++- ...rtReceivingBinsOnCreatePutawayPage.test.ts | 7 ---- ...eateMoreThan1PutawayForTheSameItem.test.ts | 9 ----- src/tests/putaway/createPutaway.test.ts | 5 --- .../putaway/deleteItemsFromPutaway.test.ts | 37 ++++++------------- .../putaway/putawayImtemWithEmptyLot.test.ts | 9 ----- .../putaway/putawayMoreThan1Item.test.ts | 8 ---- src/tests/putaway/putawayToHoldBin.test.ts | 5 --- .../putaway/putawayToPreferredBin.test.ts | 10 ----- src/tests/putaway/splitLineInPutaway.test.ts | 12 +----- ...dationOnQtyRemovedFromReceivingBin.test.ts | 2 - .../assertCreationOfGoodsReceiptNote.test.ts | 9 ++--- .../receiving/cancelRemainingQty.test.ts | 26 ++++--------- .../editBinLocationWhenReceive.test.ts | 15 +------- .../receiving/editOriginalLineQtyTo0.test.ts | 6 +-- ...eInboundWithoutPickAndPutawayStock.test.ts | 4 +- src/tests/receiving/receiveToHoldBin.test.ts | 6 +-- .../receiving/receivingStatusChanges.test.ts | 33 +++++------------ ...atusChangesWithoutPartialReceiving.test.ts | 31 +++++----------- .../receiving/rollbackStatusChanges.test.ts | 24 ++++-------- 25 files changed, 97 insertions(+), 209 deletions(-) diff --git a/src/pages/putaway/putawayDetails/components/ItemDetailsTable.ts b/src/pages/putaway/putawayDetails/components/ItemDetailsTable.ts index 2f9bbbf..f0346a4 100644 --- a/src/pages/putaway/putawayDetails/components/ItemDetailsTable.ts +++ b/src/pages/putaway/putawayDetails/components/ItemDetailsTable.ts @@ -1,4 +1,4 @@ -import { Locator, Page } from '@playwright/test'; +import { expect, Locator, Page } from '@playwright/test'; import BasePageModel from '@/pages/BasePageModel'; @@ -7,6 +7,12 @@ class ItemDetailsTable extends BasePageModel { super(page); } + async isLoaded() { + await expect( + this.page.getByRole('heading').getByText('Item Details') + ).toBeVisible(); + } + get table() { return this.page.getByRole('table'); } diff --git a/src/pages/putaway/putawayDetails/components/ItemStatusTable.ts b/src/pages/putaway/putawayDetails/components/ItemStatusTable.ts index 6426087..64c361f 100644 --- a/src/pages/putaway/putawayDetails/components/ItemStatusTable.ts +++ b/src/pages/putaway/putawayDetails/components/ItemStatusTable.ts @@ -1,4 +1,4 @@ -import { Locator, Page } from '@playwright/test'; +import { expect, Locator, Page } from '@playwright/test'; import BasePageModel from '@/pages/BasePageModel'; @@ -7,6 +7,12 @@ class ItemStatusTable extends BasePageModel { super(page); } + async isLoaded() { + await expect( + this.page.getByRole('heading').getByText('Item Status') + ).toBeVisible(); + } + get table() { return this.page.getByTestId('item-status-table'); } diff --git a/src/pages/putaway/putawayDetails/components/SummaryTable.ts b/src/pages/putaway/putawayDetails/components/SummaryTable.ts index eea1fa6..7fa3cf6 100644 --- a/src/pages/putaway/putawayDetails/components/SummaryTable.ts +++ b/src/pages/putaway/putawayDetails/components/SummaryTable.ts @@ -1,4 +1,4 @@ -import { Locator, Page } from '@playwright/test'; +import { expect, Locator, Page } from '@playwright/test'; import BasePageModel from '@/pages/BasePageModel'; @@ -7,6 +7,12 @@ class SummaryTable extends BasePageModel { super(page); } + async isLoaded() { + await expect( + this.page.getByRole('heading').getByText('Summary') + ).toBeVisible(); + } + get table() { return this.page.getByRole('table'); } diff --git a/src/pages/stockMovementShow/components/DocumentsTable.ts b/src/pages/stockMovementShow/components/DocumentsTable.ts index 090ea7a..bacd82c 100644 --- a/src/pages/stockMovementShow/components/DocumentsTable.ts +++ b/src/pages/stockMovementShow/components/DocumentsTable.ts @@ -1,4 +1,4 @@ -import { Locator, Page } from '@playwright/test'; +import { expect, Locator, Page } from '@playwright/test'; import BasePageModel from '@/pages/BasePageModel'; @@ -7,6 +7,12 @@ class DocumentsListTable extends BasePageModel { super(page); } + async isLoaded() { + await expect( + this.page.getByRole('heading').getByText('Documents') + ).toBeVisible(); + } + get table() { return this.page .getByRole('region', { name: 'Documents' }) diff --git a/src/pages/stockMovementShow/components/PackingListTable.ts b/src/pages/stockMovementShow/components/PackingListTable.ts index bf91321..d61c160 100644 --- a/src/pages/stockMovementShow/components/PackingListTable.ts +++ b/src/pages/stockMovementShow/components/PackingListTable.ts @@ -1,4 +1,4 @@ -import { Locator, Page } from '@playwright/test'; +import { expect, Locator, Page } from '@playwright/test'; import BasePageModel from '@/pages/BasePageModel'; @@ -7,6 +7,12 @@ class PackingListTable extends BasePageModel { super(page); } + async isLoaded() { + await expect( + this.page.getByRole('heading').getByText('Packing List') + ).toBeVisible(); + } + get table() { return this.page .getByRole('region', { name: 'Packing List' }) diff --git a/src/pages/stockMovementShow/components/ReceiptsTable.ts b/src/pages/stockMovementShow/components/ReceiptsTable.ts index 0baca7e..b3cbb0b 100644 --- a/src/pages/stockMovementShow/components/ReceiptsTable.ts +++ b/src/pages/stockMovementShow/components/ReceiptsTable.ts @@ -1,4 +1,4 @@ -import { Locator, Page } from '@playwright/test'; +import { expect, Locator, Page } from '@playwright/test'; import BasePageModel from '@/pages/BasePageModel'; @@ -7,6 +7,12 @@ class ReceiptsListTable extends BasePageModel { super(page); } + async isLoaded() { + await expect( + this.page.getByRole('heading').getByText('Receipt') + ).toBeVisible(); + } + get table() { return this.page .getByRole('region', { name: 'Receipt' }) diff --git a/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts b/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts index 43c56f2..2291011 100644 --- a/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts +++ b/src/tests/putaway/assertReceivingBinsOnCreatePutawayPage.test.ts @@ -161,7 +161,6 @@ test.describe('Assert receiving bin on create putaway page', () => { mainLocationService, internalLocationService, putawayDetailsPage, - page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + PRIMARY_STOCK_MOVEMENT.identifier; @@ -215,8 +214,6 @@ test.describe('Assert receiving bin on create putaway page', () => { await test.step('Assert receiving bins and lot and exp on stockcard', async () => { await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -252,8 +249,6 @@ test.describe('Assert receiving bin on create putaway page', () => { await test.step('Assert receiving bins and lot and exp on stockcard after stock transfer', async () => { await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -341,8 +336,6 @@ test.describe('Assert receiving bin on create putaway page', () => { await test.step('Assert bins and lot on stockcard after putaway', async () => { await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation diff --git a/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts b/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts index d1ca6ab..5c12687 100644 --- a/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts +++ b/src/tests/putaway/createMoreThan1PutawayForTheSameItem.test.ts @@ -90,7 +90,6 @@ test.describe('Create more than 1 putaway from the same item', () => { productShowPage, putawayDetailsPage, productService, - page, }) => { const product = await productService.getProduct(Product.FIVE); const internalLocation = await internalLocationService.getLocation(); @@ -165,12 +164,8 @@ test.describe('Create more than 1 putaway from the same item', () => { await test.step('Assert putaway bin and qty on stock card', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -223,12 +218,8 @@ test.describe('Create more than 1 putaway from the same item', () => { await test.step('Assert putaway bin and qty on stock card', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation diff --git a/src/tests/putaway/createPutaway.test.ts b/src/tests/putaway/createPutaway.test.ts index 6f55efd..97c1218 100644 --- a/src/tests/putaway/createPutaway.test.ts +++ b/src/tests/putaway/createPutaway.test.ts @@ -90,7 +90,6 @@ test.describe('Putaway received inbound shipment', () => { productShowPage, putawayDetailsPage, productService, - page, }) => { await test.step('Go to stock movement show page and assert received status', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -135,13 +134,9 @@ test.describe('Putaway received inbound shipment', () => { await test.step('Assert putaway bin on stock card', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); const product = await productService.getProduct(Product.FIVE); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); const internalLocation = await internalLocationService.getLocation(); await expect( diff --git a/src/tests/putaway/deleteItemsFromPutaway.test.ts b/src/tests/putaway/deleteItemsFromPutaway.test.ts index 68bfbbd..012bb39 100644 --- a/src/tests/putaway/deleteItemsFromPutaway.test.ts +++ b/src/tests/putaway/deleteItemsFromPutaway.test.ts @@ -99,7 +99,6 @@ test.describe('Delete items from putaway', () => { internalLocationService, putawayDetailsPage, putawayListPage, - page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -146,8 +145,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on summary tab', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.summaryTable.isLoaded(); await expect(putawayDetailsPage.summaryTable.orderItemRows).toHaveCount( 2 ); @@ -155,8 +153,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on status table', async () => { await putawayDetailsPage.itemStatusTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemStatusTable.isLoaded(); await expect( putawayDetailsPage.itemStatusTable.orderItemRows ).toHaveCount(2); @@ -164,8 +161,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on item details table', async () => { await putawayDetailsPage.itemDetailsTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemDetailsTable.isLoaded(); await expect( putawayDetailsPage.itemDetailsTable.orderItemRows ).toHaveCount(2); @@ -199,8 +195,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on summary tab', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.summaryTable.isLoaded(); await expect(putawayDetailsPage.summaryTable.orderItemRows).toHaveCount( 1 ); @@ -208,8 +203,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemStatusTable.isLoaded(); await expect( putawayDetailsPage.itemStatusTable.orderItemRows ).toHaveCount(1); @@ -217,8 +211,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on item details table', async () => { await putawayDetailsPage.itemDetailsTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemDetailsTable.isLoaded(); await expect( putawayDetailsPage.itemDetailsTable.orderItemRows ).toHaveCount(1); @@ -283,8 +276,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on summary tab', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.summaryTable.isLoaded(); await expect(putawayDetailsPage.summaryTable.orderItemRows).toHaveCount( 2 ); @@ -292,8 +284,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemStatusTable.isLoaded(); await expect( putawayDetailsPage.itemStatusTable.orderItemRows ).toHaveCount(2); @@ -301,8 +292,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on item details table', async () => { await putawayDetailsPage.itemDetailsTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemDetailsTable.isLoaded(); await expect( putawayDetailsPage.itemDetailsTable.orderItemRows ).toHaveCount(2); @@ -339,8 +329,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on summary tab on completed putaway', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.summaryTable.isLoaded(); await expect(putawayDetailsPage.summaryTable.orderItemRows).toHaveCount( 2 ); @@ -348,8 +337,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on items status table on completed putaway', async () => { await putawayDetailsPage.itemStatusTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemStatusTable.isLoaded(); await expect( putawayDetailsPage.itemStatusTable.orderItemRows ).toHaveCount(2); @@ -357,8 +345,7 @@ test.describe('Delete items from putaway', () => { await test.step('Assert number of lines on item details table on completed putaway', async () => { await putawayDetailsPage.itemDetailsTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemDetailsTable.isLoaded(); await expect( putawayDetailsPage.itemDetailsTable.orderItemRows ).toHaveCount(2); diff --git a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts index 5f0db13..ad7cc90 100644 --- a/src/tests/putaway/putawayImtemWithEmptyLot.test.ts +++ b/src/tests/putaway/putawayImtemWithEmptyLot.test.ts @@ -89,7 +89,6 @@ test.describe('Putaway item with empty lot', () => { productShowPage, putawayDetailsPage, productService, - page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -101,8 +100,6 @@ test.describe('Putaway item with empty lot', () => { await test.step('Go to stockcard', async () => { await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); }); @@ -133,8 +130,6 @@ test.describe('Putaway item with empty lot', () => { ); await productShowPage.inStockTabSection.stockTransferDialog.transferStockButton.click(); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -208,12 +203,8 @@ test.describe('Putaway item with empty lot', () => { await test.step('Assert putaway bin on stock card', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation diff --git a/src/tests/putaway/putawayMoreThan1Item.test.ts b/src/tests/putaway/putawayMoreThan1Item.test.ts index 4b813d9..512892d 100644 --- a/src/tests/putaway/putawayMoreThan1Item.test.ts +++ b/src/tests/putaway/putawayMoreThan1Item.test.ts @@ -100,7 +100,6 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { productShowPage, putawayDetailsPage, putawayListPage, - page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -230,8 +229,6 @@ test.describe('Create putaway for more than 1 item, separate putaways', () => { await test.step('Assert putaway bin on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation @@ -337,7 +334,6 @@ test.describe('Putaway 2 items in the same putaway', () => { productShowPage, putawayDetailsPage, productService, - page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -404,8 +400,6 @@ test.describe('Putaway 2 items in the same putaway', () => { await test.step('Assert putaway bin on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( @@ -413,8 +407,6 @@ test.describe('Putaway 2 items in the same putaway', () => { ).toHaveText(internalLocation.name); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( diff --git a/src/tests/putaway/putawayToHoldBin.test.ts b/src/tests/putaway/putawayToHoldBin.test.ts index 0ca7ea5..993cde4 100644 --- a/src/tests/putaway/putawayToHoldBin.test.ts +++ b/src/tests/putaway/putawayToHoldBin.test.ts @@ -133,7 +133,6 @@ test.describe('Putaway item into hold bin', () => { navbar, productShowPage, productService, - page, }) => { await test.step('Go to stock movement show page and assert received status', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -177,13 +176,9 @@ test.describe('Putaway item into hold bin', () => { await test.step('Assert putaway bin on stock card', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); const product = await productService.getProduct(Product.FIVE); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation diff --git a/src/tests/putaway/putawayToPreferredBin.test.ts b/src/tests/putaway/putawayToPreferredBin.test.ts index 8032a81..b979b0b 100644 --- a/src/tests/putaway/putawayToPreferredBin.test.ts +++ b/src/tests/putaway/putawayToPreferredBin.test.ts @@ -127,7 +127,6 @@ test.describe('Putaway to preferred bin and default bin', () => { internalLocationService, productShowPage, putawayDetailsPage, - page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -202,16 +201,12 @@ test.describe('Putaway to preferred bin and default bin', () => { await test.step('Assert putaway bin on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation ).toHaveText(internalLocation.name); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).defaultBinLocation @@ -227,7 +222,6 @@ test.describe('Putaway to preferred bin and default bin', () => { internalLocation2Service, productShowPage, putawayDetailsPage, - page, }) => { const receivingBin = AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier; @@ -289,8 +283,6 @@ test.describe('Putaway to preferred bin and default bin', () => { await test.step('Assert content of items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await expect( putawayDetailsPage.itemStatusTable.row(1).itemStatus ).toHaveText('COMPLETED'); @@ -305,8 +297,6 @@ test.describe('Putaway to preferred bin and default bin', () => { await test.step('Assert putaway bin on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation diff --git a/src/tests/putaway/splitLineInPutaway.test.ts b/src/tests/putaway/splitLineInPutaway.test.ts index 87e55f0..2cd5b49 100644 --- a/src/tests/putaway/splitLineInPutaway.test.ts +++ b/src/tests/putaway/splitLineInPutaway.test.ts @@ -94,7 +94,6 @@ test.describe('Split line in Putaway', () => { putawayDetailsPage, productShowPage, productService, - page, }) => { const internalLocation = await internalLocationService.getLocation(); const internalLocation2 = await internalLocation2Service.getLocation(); @@ -161,8 +160,7 @@ test.describe('Split line in Putaway', () => { await test.step('Assert content of items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemStatusTable.isLoaded(); await expect( putawayDetailsPage.itemStatusTable.row(1).itemStatus ).toHaveText('COMPLETED'); @@ -185,13 +183,9 @@ test.describe('Split line in Putaway', () => { await test.step('Assert putaway bin on stock card', async () => { await putawayDetailsPage.summaryTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); const product = await productService.getProduct(Product.FIVE); await productShowPage.goToPage(product.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(1).binLocation @@ -209,7 +203,6 @@ test.describe('Split line in Putaway', () => { internalLocationService, internalLocation2Service, putawayDetailsPage, - page, }) => { const internalLocation = await internalLocationService.getLocation(); const internalLocation2 = await internalLocation2Service.getLocation(); @@ -338,8 +331,7 @@ test.describe('Split line in Putaway', () => { await test.step('Assert content of items status table', async () => { await putawayDetailsPage.itemStatusTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await putawayDetailsPage.itemStatusTable.isLoaded(); await expect( putawayDetailsPage.itemStatusTable.row(1).itemStatus ).toHaveText('COMPLETED'); diff --git a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts index f7f43d9..47897ba 100644 --- a/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts +++ b/src/tests/putaway/validationOnQtyRemovedFromReceivingBin.test.ts @@ -268,8 +268,6 @@ test.describe('Assert validation on qty removed from receiving bin', () => { await test.step('Assert putaway bin and qty on stock card', async () => { await productShowPage.goToPage(product2.id); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation diff --git a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts index ca600a8..37793c4 100644 --- a/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts +++ b/src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts @@ -83,8 +83,7 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { await test.step('Go to Documnents tab and assert Goods receipt note is not visible', async () => { await stockMovementShowPage.documentTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.documentsListTable.isLoaded(); await expect( stockMovementShowPage.documentsListTable .row(7) @@ -124,8 +123,7 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { await test.step('Assert Goods receipt note is created and opened for partially received shipment', async () => { await stockMovementShowPage.documentTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.documentsListTable.isLoaded(); await expect( stockMovementShowPage.documentsListTable .row(7) @@ -163,8 +161,7 @@ test.describe('Assert Goods Receipt Note is created and opened', () => { await test.step('Assert Goods receipt note is created and opened for received shipment', async () => { await stockMovementShowPage.documentTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.documentsListTable.isLoaded(); await expect( stockMovementShowPage.documentsListTable .row(7) diff --git a/src/tests/receiving/cancelRemainingQty.test.ts b/src/tests/receiving/cancelRemainingQty.test.ts index 3b37a4a..421a925 100644 --- a/src/tests/receiving/cancelRemainingQty.test.ts +++ b/src/tests/receiving/cancelRemainingQty.test.ts @@ -73,7 +73,6 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Cancel remaining qty when receive item partially', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -126,8 +125,7 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await expect( stockMovementShowPage.receiptListTable.row(1).quantityCanceled ).toHaveText('50'); @@ -146,7 +144,6 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Cancel remaining qty when receive items in 2nd receipt', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -181,8 +178,7 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await expect( stockMovementShowPage.receiptListTable.row(1).quantityReceived ).toHaveText('50'); @@ -240,8 +236,7 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await expect( stockMovementShowPage.receiptListTable.row(2).quantityCanceled ).toHaveText('10'); @@ -265,7 +260,6 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Assert remaining qty and disabled cancel remaining checkbox when receive qty bigger than shipped', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -312,8 +306,7 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled and received qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await expect( stockMovementShowPage.receiptListTable.row(1).quantityCanceled ).toHaveText('0'); @@ -332,7 +325,6 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Cancel remaining qty using cancel all remaining button', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -386,8 +378,7 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await expect( stockMovementShowPage.receiptListTable.row(1).quantityCanceled ).toHaveText('50'); @@ -406,7 +397,6 @@ test.describe('Cancel qty in the middle of receipt', () => { test('Assert cancel checkbox selection when going forward and backward', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -453,8 +443,7 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled and received qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.packingListTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.packingListTable.isLoaded(); await expect( stockMovementShowPage.packingListTable.row(1).quantityShipped ).toHaveText('100'); @@ -503,8 +492,7 @@ test.describe('Cancel qty in the middle of receipt', () => { await test.step('Assert canceled and received qty on stock movement show page', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.packingListTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.packingListTable.isLoaded(); await expect( stockMovementShowPage.packingListTable.row(2).quantityShipped ).toHaveText('10'); diff --git a/src/tests/receiving/editBinLocationWhenReceive.test.ts b/src/tests/receiving/editBinLocationWhenReceive.test.ts index 3ef71c9..9d4bc57 100644 --- a/src/tests/receiving/editBinLocationWhenReceive.test.ts +++ b/src/tests/receiving/editBinLocationWhenReceive.test.ts @@ -128,7 +128,6 @@ test.describe('Edit Bin Location when receive inbound stock movement', () => { stockMovementShowPage, receivingPage, productShowPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -164,8 +163,6 @@ test.describe('Edit Bin Location when receive inbound stock movement', () => { }); await test.step('Assert edited bin on Packing list', async () => { - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText(binLocationName); @@ -174,8 +171,6 @@ test.describe('Edit Bin Location when receive inbound stock movement', () => { await test.step('Go to product page and assert bin location', async () => { await stockMovementShowPage.packingListTable.row(1).product.click(); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation @@ -346,7 +341,6 @@ test.describe('Edit Bin Location to bin with zone when receive inbound stock mov stockMovementShowPage, receivingPage, productShowPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -390,8 +384,7 @@ test.describe('Edit Bin Location to bin with zone when receive inbound stock mov }); await test.step('Assert edited bin on Packing list', async () => { - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.packingListTable.isLoaded(); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText(binLocationName); @@ -400,8 +393,6 @@ test.describe('Edit Bin Location to bin with zone when receive inbound stock mov await test.step('Go to product page and assert bin location', async () => { await stockMovementShowPage.packingListTable.row(1).product.click(); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).zoneLocation @@ -532,7 +523,6 @@ test.describe('Edit Bin Location when receive for all lines', () => { test('Edit Bin location when receive for all lines', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -578,8 +568,7 @@ test.describe('Edit Bin Location when receive for all lines', () => { }); await test.step('Assert edited bin on Packing list', async () => { - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.packingListTable.isLoaded(); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText(binLocationName); diff --git a/src/tests/receiving/editOriginalLineQtyTo0.test.ts b/src/tests/receiving/editOriginalLineQtyTo0.test.ts index 3fd76a0..b9038aa 100644 --- a/src/tests/receiving/editOriginalLineQtyTo0.test.ts +++ b/src/tests/receiving/editOriginalLineQtyTo0.test.ts @@ -285,7 +285,6 @@ test.describe('Edit original line to other product in the middle of receipt', () stockMovementShowPage, receivingPage, productService, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -378,14 +377,11 @@ test.describe('Edit original line to other product in the middle of receipt', () const PRODUCT_FOUR = await productService.getProduct(Product.FOUR); const PRODUCT_FIVE = await productService.getProduct(Product.FIVE); await stockMovementShowPage.packingListTab.isVisible(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await expect( stockMovementShowPage.packingListTable.row(1).product ).toHaveText(PRODUCT_FOUR.name); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await expect( stockMovementShowPage.receiptListTable.row(1).product ).toHaveText(PRODUCT_FIVE.name); diff --git a/src/tests/receiving/receiveInboundWithoutPickAndPutawayStock.test.ts b/src/tests/receiving/receiveInboundWithoutPickAndPutawayStock.test.ts index 9c3782e..448d424 100644 --- a/src/tests/receiving/receiveInboundWithoutPickAndPutawayStock.test.ts +++ b/src/tests/receiving/receiveInboundWithoutPickAndPutawayStock.test.ts @@ -64,7 +64,6 @@ test.describe('Receive inbound stock movement in location without pick and putaw stockMovementShowPage, receivingPage, authService, - page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation( @@ -149,8 +148,7 @@ test.describe('Receive inbound stock movement in location without pick and putaw }); await test.step('Assert Default bin on Packing list', async () => { - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.packingListTable.isLoaded(); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText('Default'); diff --git a/src/tests/receiving/receiveToHoldBin.test.ts b/src/tests/receiving/receiveToHoldBin.test.ts index 4932f6c..bbff5d4 100644 --- a/src/tests/receiving/receiveToHoldBin.test.ts +++ b/src/tests/receiving/receiveToHoldBin.test.ts @@ -96,7 +96,6 @@ test.describe('Receive item into hold bin', () => { stockMovementShowPage, receivingPage, productShowPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -132,8 +131,7 @@ test.describe('Receive item into hold bin', () => { }); await test.step('Assert edited bin on Packing list', async () => { - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.packingListTable.isLoaded(); await expect( stockMovementShowPage.packingListTable.row(1).binLocation ).toHaveText(holdBinLocationName); @@ -142,8 +140,6 @@ test.describe('Receive item into hold bin', () => { await test.step('Go to product page and assert bin location', async () => { await stockMovementShowPage.packingListTable.row(1).product.click(); await productShowPage.inStockTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await productShowPage.inStockTabSection.isLoaded(); await expect( productShowPage.inStockTabSection.row(2).binLocation diff --git a/src/tests/receiving/receivingStatusChanges.test.ts b/src/tests/receiving/receivingStatusChanges.test.ts index e21b529..9efc174 100644 --- a/src/tests/receiving/receivingStatusChanges.test.ts +++ b/src/tests/receiving/receivingStatusChanges.test.ts @@ -77,7 +77,6 @@ test.describe('Status changes on sm view page when receive shipment', () => { stockMovementShowPage, receivingPage, browser, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -90,8 +89,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -120,8 +118,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await newStockMovementShowPage.isLoaded(); await expect(newStockMovementShowPage.statusTag).toHaveText('Shipped'); await newStockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await newStockMovementShowPage.receiptListTable.isLoaded(); await newStockMovementShowPage.receiptTab.isVisible(); await expect( newStockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -144,8 +141,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert statuses on stock movmenent show page after receiving item partially', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -163,7 +159,6 @@ test.describe('Status changes on sm view page when receive shipment', () => { stockMovementShowPage, receivingPage, browser, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -176,8 +171,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -206,8 +200,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await newStockMovementShowPage.isLoaded(); await expect(newStockMovementShowPage.statusTag).toHaveText('Shipped'); await newStockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await newStockMovementShowPage.receiptListTable.isLoaded(); await newStockMovementShowPage.receiptTab.isVisible(); await expect( newStockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -230,8 +223,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert statuses on stock movmenent show page after receiving fully 1 of items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -249,7 +241,6 @@ test.describe('Status changes on sm view page when receive shipment', () => { stockMovementShowPage, receivingPage, browser, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -262,8 +253,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -295,8 +285,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await newStockMovementShowPage.isLoaded(); await expect(newStockMovementShowPage.statusTag).toHaveText('Shipped'); await newStockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await newStockMovementShowPage.receiptListTable.isLoaded(); await newStockMovementShowPage.receiptTab.isVisible(); await expect( newStockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -328,8 +317,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert statuses on stock movmenent show page after receiving items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -373,8 +361,7 @@ test.describe('Status changes on sm view page when receive shipment', () => { await test.step('Assert statuses on stock movmenent show page after receiving items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(3).receiptStatus diff --git a/src/tests/receiving/receivingStatusChangesWithoutPartialReceiving.test.ts b/src/tests/receiving/receivingStatusChangesWithoutPartialReceiving.test.ts index b726217..b7d0275 100644 --- a/src/tests/receiving/receivingStatusChangesWithoutPartialReceiving.test.ts +++ b/src/tests/receiving/receivingStatusChangesWithoutPartialReceiving.test.ts @@ -69,7 +69,6 @@ test.describe('Status changes on sm view page when receive shipment in location stockMovementShowPage, receivingPage, authService, - page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation(AppConfig.instance.locations.depot.id); @@ -83,8 +82,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -118,8 +116,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert Qty and statuses on receipt tab after receiving item partially and cancel not received qty', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -152,7 +149,6 @@ test.describe('Status changes on sm view page when receive shipment in location stockMovementShowPage, receivingPage, authService, - page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation(AppConfig.instance.locations.depot.id); @@ -166,8 +162,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -201,8 +196,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert Qty and statuses on receipt tab after receiving item partially and cancel not received qty', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -235,7 +229,6 @@ test.describe('Status changes on sm view page when receive shipment in location stockMovementShowPage, receivingPage, authService, - page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation(AppConfig.instance.locations.depot.id); @@ -249,8 +242,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -283,8 +275,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert Qty and statuses on receipt tab after receiving items and cancel not received qty', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -317,7 +308,6 @@ test.describe('Status changes on sm view page when receive shipment in location stockMovementShowPage, receivingPage, authService, - page, }) => { await test.step('Go to stock movement show page', async () => { await authService.changeLocation(AppConfig.instance.locations.depot.id); @@ -331,8 +321,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -365,8 +354,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert Qty and statuses on receipt tab after receiving items and cancel not received qty', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -405,8 +393,7 @@ test.describe('Status changes on sm view page when receive shipment in location await test.step('Assert empty receipt tab after rollback receipt', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); diff --git a/src/tests/receiving/rollbackStatusChanges.test.ts b/src/tests/receiving/rollbackStatusChanges.test.ts index 0cc6100..19b359e 100644 --- a/src/tests/receiving/rollbackStatusChanges.test.ts +++ b/src/tests/receiving/rollbackStatusChanges.test.ts @@ -77,7 +77,6 @@ test.describe('Status changes on sm view page when rollback receipts', () => { test('Assert status changes on view page and receipt tab when rollback partial receipt of 1 item', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -107,8 +106,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert statuses on stock movmenent show page after receiving item partially', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -131,8 +129,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert empty receipt tab after rollback last receipt', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -141,7 +138,6 @@ test.describe('Status changes on sm view page when rollback receipts', () => { test('Assert status changes on view page and receipt tab when receive 1 item fully', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -171,8 +167,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert statuses on stock movmenent show page after receiving fully 1 of items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -195,8 +190,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert empty receipt tab after rollback last receipt', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); @@ -205,7 +199,6 @@ test.describe('Status changes on sm view page when rollback receipts', () => { test('Assert status changes on view page and receipt tab when receive 1 item fully and 1 partially', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -257,8 +250,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert statuses on stock movmenent show page after receiving items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Received'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(3).receiptStatus @@ -279,8 +271,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert statuses on stock movmenent show page after receiving items', async () => { await expect(stockMovementShowPage.statusTag).toHaveText('Receiving'); await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect( stockMovementShowPage.receiptListTable.row(1).receiptStatus @@ -313,8 +304,7 @@ test.describe('Status changes on sm view page when rollback receipts', () => { await test.step('Assert empty receipt tab after rollback both receipts', async () => { await stockMovementShowPage.receiptTab.click(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); + await stockMovementShowPage.receiptListTable.isLoaded(); await stockMovementShowPage.receiptTab.isVisible(); await expect(stockMovementShowPage.emptyReceiptTab).toBeVisible(); }); From 11dcc3f993b2b0149d816ece55648ce2bdb54587 Mon Sep 17 00:00:00 2001 From: Katarzyna Date: Wed, 24 Jun 2026 19:43:05 +0200 Subject: [PATCH 12/12] improve asserting if gsp tabs are loaded --- src/tests/receiving/validationsOnEditAndReceive.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tests/receiving/validationsOnEditAndReceive.test.ts b/src/tests/receiving/validationsOnEditAndReceive.test.ts index 8c6c6ab..3192ee5 100644 --- a/src/tests/receiving/validationsOnEditAndReceive.test.ts +++ b/src/tests/receiving/validationsOnEditAndReceive.test.ts @@ -222,7 +222,6 @@ test.describe('Validations on edit and receive inbound stock movement', () => { test('Assert unable to receive already received inbounds', async ({ stockMovementShowPage, receivingPage, - page, }) => { await test.step('Go to stock movement show page', async () => { await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id); @@ -253,8 +252,6 @@ test.describe('Validations on edit and receive inbound stock movement', () => { await test.step('Validation on receive already received inbound', async () => { await stockMovementShowPage.isLoaded(); - // eslint-disable-next-line playwright/no-networkidle - await page.waitForLoadState('networkidle'); await stockMovementShowPage.receiveButton.click(); await expect(stockMovementShowPage.errorMessage).toBeVisible({ timeout: 10000,