Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,9 @@ test.describe('Sort putaway by current bin, preferred bin and original order', (
await createPutawayPage.startStep.isLoaded();

// Putaway A into binTwo (its preferred bin is auto-suggested).
await createPutawayPage.startStep.table.row(0).putawayBinSelect.click();
await createPutawayPage.startStep.table
.row(0)
.getPutawayBin(binTwo.name)
.click();
await expect(
createPutawayPage.startStep.table.row(0).putawayBinSelect
).toContainText(binTwo.name);
await createPutawayPage.startStep.nextButton.click();
await createPutawayPage.completeStep.isLoaded();
await createPutawayPage.completeStep.completePutawayButton.click();
Expand Down
21 changes: 8 additions & 13 deletions src/tests/receiving/assertBinLocationField.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { expect, test } from '@/fixtures/fixtures';
import { Product } from '@/generated/ProductCodes.generated';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { deleteReceivedShipment } from '@/utils/shipmentUtils';

test.describe('Assert bin location not clearable', () => {
let STOCK_MOVEMENT: StockMovementResponse;
Expand Down Expand Up @@ -45,22 +46,16 @@ test.describe('Assert bin location not clearable', () => {
page,
locationListPage,
createLocationPage,
oldViewShipmentPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

if (isRollbackButtonVisible) {
await stockMovementShowPage.rollbackButton.click();
}

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
Expand Down
12 changes: 9 additions & 3 deletions src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Product } from '@/generated/ProductCodes.generated';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { pageContainsValues } from '@/utils/pageUtils';
import { deleteReceivedShipment } from '@/utils/shipmentUtils';
import { captureRowValues } from '@/utils/tableUtils';

test.describe('Assert Goods Receipt Note is created and opened', () => {
Expand Down Expand Up @@ -46,11 +47,16 @@ test.describe('Assert Goods Receipt Note is created and opened', () => {
page,
locationListPage,
createLocationPage,
oldViewShipmentPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.rollbackLastReceiptButton.click();
await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);

await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
Expand Down
11 changes: 9 additions & 2 deletions src/tests/receiving/assertCreationOfReceivingBin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import CreateLocationPage from '@/pages/location/createLocation/CreateLocationPa
import LocationListPage from '@/pages/location/LocationListPage';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { deleteReceivedShipment } from '@/utils/shipmentUtils';

test.describe('Assert creation of receiving bin', () => {
test.describe.configure({ timeout: 60000 });
Expand Down Expand Up @@ -52,10 +53,16 @@ test.describe('Assert creation of receiving bin', () => {
page,
locationListPage,
createLocationPage,
oldViewShipmentPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);

await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});

const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
Expand Down
21 changes: 8 additions & 13 deletions src/tests/receiving/assertQtyInputs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Product } from '@/generated/ProductCodes.generated';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { formatDate, getDateByOffset } from '@/utils/DateUtils';
import { deleteReceivedShipment } from '@/utils/shipmentUtils';

test.describe('Assert if quantity inputs remain when split lines', () => {
let STOCK_MOVEMENT: StockMovementResponse;
Expand Down Expand Up @@ -50,22 +51,16 @@ test.describe('Assert if quantity inputs remain when split lines', () => {
page,
locationListPage,
createLocationPage,
oldViewShipmentPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

if (isRollbackButtonVisible) {
await stockMovementShowPage.rollbackButton.click();
}

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});

const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
Expand Down
21 changes: 8 additions & 13 deletions src/tests/receiving/assertRecipientField.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { expect, test } from '@/fixtures/fixtures';
import { Product } from '@/generated/ProductCodes.generated';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { deleteReceivedShipment } from '@/utils/shipmentUtils';

test.describe('Assert recipient field when receive', () => {
let STOCK_MOVEMENT: StockMovementResponse;
Expand Down Expand Up @@ -53,22 +54,16 @@ test.describe('Assert recipient field when receive', () => {
page,
locationListPage,
createLocationPage,
oldViewShipmentPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

if (isRollbackButtonVisible) {
await stockMovementShowPage.rollbackButton.click();
}

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});

const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
Expand Down
21 changes: 8 additions & 13 deletions src/tests/receiving/cancelRemainingQty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { expect, test } from '@/fixtures/fixtures';
import { Product } from '@/generated/ProductCodes.generated';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { deleteReceivedShipment } from '@/utils/shipmentUtils';

test.describe('Cancel qty in the middle of receipt', () => {
let STOCK_MOVEMENT: StockMovementResponse;
Expand Down Expand Up @@ -47,22 +48,16 @@ test.describe('Cancel qty in the middle of receipt', () => {
page,
locationListPage,
createLocationPage,
oldViewShipmentPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

if (isRollbackButtonVisible) {
await stockMovementShowPage.rollbackButton.click();
}

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
Expand Down
41 changes: 24 additions & 17 deletions src/tests/receiving/editBinLocationWhenReceive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { expect, test } from '@/fixtures/fixtures';
import { Product } from '@/generated/ProductCodes.generated';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { deleteReceivedShipment } from '@/utils/shipmentUtils';
import UniqueIdentifier from '@/utils/UniqueIdentifier';

test.describe('Edit Bin Location when receive inbound stock movement', () => {
Expand Down Expand Up @@ -74,23 +75,19 @@ test.describe('Edit Bin Location when receive inbound stock movement', () => {
locationListPage,
mainLocationService,
createLocationPage,
oldViewShipmentPage,
}) => {
const mainLocation = await mainLocationService.getLocation();
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);

const hasRollbackLastReceipt =
await stockMovementShowPage.rollbackLastReceiptButton
.isVisible()
.catch(() => false);

if (hasRollbackLastReceipt) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});

await test.step('Deactivate created bin location', async () => {
await page.goto(LOCATION_URL.list());
Expand Down Expand Up @@ -275,14 +272,19 @@ test.describe('Edit Bin Location to bin with zone when receive inbound stock mov
locationListPage,
mainLocationService,
createLocationPage,
oldViewShipmentPage,
}) => {
const mainLocation = await mainLocationService.getLocation();
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.rollbackLastReceiptButton.click();
await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);

await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});

await test.step('Deactivate created bin location', async () => {
await page.goto(LOCATION_URL.list());
Expand Down Expand Up @@ -468,14 +470,19 @@ test.describe('Edit Bin Location when receive for all lines', () => {
locationListPage,
mainLocationService,
createLocationPage,
oldViewShipmentPage,
}) => {
const mainLocation = await mainLocationService.getLocation();
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.rollbackLastReceiptButton.click();
await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);

await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});

await test.step('Deactivate created bin location', async () => {
await page.goto(LOCATION_URL.list());
Expand Down
41 changes: 15 additions & 26 deletions src/tests/receiving/editOriginalLineQtyTo0.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Product } from '@/generated/ProductCodes.generated';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { getDateByOffset } from '@/utils/DateUtils';
import { deleteReceivedShipment } from '@/utils/shipmentUtils';
import UniqueIdentifier from '@/utils/UniqueIdentifier';

test.describe('Edit qty of original line to 0', () => {
Expand Down Expand Up @@ -63,22 +64,16 @@ test.describe('Edit qty of original line to 0', () => {
page,
locationListPage,
createLocationPage,
oldViewShipmentPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

if (isRollbackButtonVisible) {
await stockMovementShowPage.rollbackButton.click();
}

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});

const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
Expand Down Expand Up @@ -264,22 +259,16 @@ test.describe('Edit original line to other product in the middle of receipt', ()
page,
locationListPage,
createLocationPage,
oldViewShipmentPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

if (isRollbackButtonVisible) {
await stockMovementShowPage.rollbackButton.click();
}

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
await deleteReceivedShipment({
stockMovementShowPage,
oldViewShipmentPage,
stockMovementService,
STOCK_MOVEMENT,
});
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
Expand Down
Loading
Loading