Skip to content
Merged
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
1 change: 0 additions & 1 deletion src/tests/inbound/createInbound/exportItems.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ test.describe('Export all incoming items', () => {
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

// due to failed test, shipment might not be received which will not show the button
if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}
Expand Down
52 changes: 35 additions & 17 deletions src/tests/receiving/assertBinLocationField.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
import { ShipmentType } from '@/constants/ShipmentType';
import { expect, test } from '@/fixtures/fixtures';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';

test.describe('Assert bin location not clearable', () => {
let STOCK_MOVEMENT: StockMovementResponse;
Expand Down Expand Up @@ -35,24 +36,41 @@ test.describe('Assert bin location not clearable', () => {
}
);

test.afterEach(async ({ stockMovementShowPage, stockMovementService }) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();
test.afterEach(
async ({
stockMovementShowPage,
stockMovementService,
mainLocationService,
page,
locationListPage,
createLocationPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

// due to failed test, shipment might not be received which will not show the button
if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}
if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

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

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
});
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
mainLocationService,
locationListPage,
createLocationPage,
page,
receivingBin,
});
}
);

test('Assert bin location not clearable', async ({
stockMovementShowPage,
Expand All @@ -69,7 +87,7 @@ test.describe('Assert bin location not clearable', () => {
});

await test.step('Assert bin location cant be cleared', async () => {
await expect(
await expect(
receivingPage.receivingStep.table
.row(1)
.binLocationSelect.locator('.react-select__clear-indicator')
Expand All @@ -89,7 +107,7 @@ test.describe('Assert bin location not clearable', () => {
await receivingPage.receivingStep.editModal.saveButton.click();
});

await test.step('Assertbin location field content after split linw', async () => {
await test.step('Assert bin location field content after split line', async () => {
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await expect(
Expand Down
32 changes: 26 additions & 6 deletions src/tests/receiving/assertCreationOfGoodsReceiptNote.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import AppConfig from '@/config/AppConfig';
import { ShipmentType } from '@/constants/ShipmentType';
import { expect, test } from '@/fixtures/fixtures';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';

test.describe('Assert Goods Receipt Note is created and opened', () => {
let STOCK_MOVEMENT: StockMovementResponse;
Expand Down Expand Up @@ -34,12 +36,30 @@ test.describe('Assert Goods Receipt Note is created and opened', () => {
}
);

test.afterEach(async ({ stockMovementShowPage, stockMovementService }) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.rollbackLastReceiptButton.click();
await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
});
test.afterEach(
async ({
stockMovementShowPage,
stockMovementService,
mainLocationService,
page,
locationListPage,
createLocationPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.rollbackLastReceiptButton.click();
await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
mainLocationService,
locationListPage,
createLocationPage,
page,
receivingBin,
});
}
);

test('Assert Goods Receipt note is created', async ({
stockMovementShowPage,
Expand Down
30 changes: 25 additions & 5 deletions src/tests/receiving/assertCreationOfReceivingBin.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 CreateLocationPage from '@/pages/location/createLocation/CreateLocationPage';
import LocationListPage from '@/pages/location/LocationListPage';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';

test.describe('Assert creation of receiving bin', () => {
test.describe.configure({ timeout: 60000 });
Expand Down Expand Up @@ -42,11 +43,30 @@ test.describe('Assert creation of receiving bin', () => {
}
);

test.afterEach(async ({ stockMovementShowPage, stockMovementService }) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
});
test.afterEach(
async ({
stockMovementShowPage,
stockMovementService,
mainLocationService,
page,
locationListPage,
createLocationPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.rollbackButton.click();
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);

const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
mainLocationService,
locationListPage,
createLocationPage,
page,
receivingBin,
});
}
);

test('Assert receiving bin is not created when shipment is shipped', async ({
stockMovementShowPage,
Expand Down
50 changes: 35 additions & 15 deletions src/tests/receiving/assertQtyInputs.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import AppConfig from '@/config/AppConfig';
import { ShipmentType } from '@/constants/ShipmentType';
import { expect, test } from '@/fixtures/fixtures';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';
import { formatDate, getDateByOffset } from '@/utils/DateUtils';

test.describe('Assert if quantity inputs remain when split lines', () => {
Expand Down Expand Up @@ -41,24 +43,42 @@ test.describe('Assert if quantity inputs remain when split lines', () => {
}
);

test.afterEach(async ({ stockMovementShowPage, stockMovementService }) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();
test.afterEach(
async ({
stockMovementShowPage,
stockMovementService,
mainLocationService,
page,
locationListPage,
createLocationPage,
}) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

// due to failed test, shipment might not be received which will not show the button
if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}
if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

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

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
});
await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);

const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
mainLocationService,
locationListPage,
createLocationPage,
page,
receivingBin,
});
}
);

test('Assert quantity input after split line', async ({
stockMovementShowPage,
Expand Down
54 changes: 37 additions & 17 deletions src/tests/receiving/assertRecipientField.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import AppConfig from '@/config/AppConfig';
import { ShipmentType } from '@/constants/ShipmentType';
import { expect, test } from '@/fixtures/fixtures';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';

test.describe('Assert recipient field when receive', () => {
let STOCK_MOVEMENT: StockMovementResponse;
Expand Down Expand Up @@ -43,24 +45,42 @@ test.describe('Assert recipient field when receive', () => {
}
);

test.afterEach(async ({ stockMovementShowPage, stockMovementService }) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

// due to failed test, shipment might not be received which will not show the button
if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

if (isRollbackButtonVisible) {
await stockMovementShowPage.rollbackButton.click();
test.afterEach(
async ({
stockMovementShowPage,
stockMovementService,
mainLocationService,
page,
locationListPage,
createLocationPage,
}) => {
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);

const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
mainLocationService,
locationListPage,
createLocationPage,
page,
receivingBin,
});
}

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
});
);

test('Assert recipient field filled and disabled', async ({
stockMovementShowPage,
Expand Down
53 changes: 36 additions & 17 deletions src/tests/receiving/cancelRemainingQty.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import AppConfig from '@/config/AppConfig';
import { ShipmentType } from '@/constants/ShipmentType';
import { expect, test } from '@/fixtures/fixtures';
import { StockMovementResponse } from '@/types';
import BinLocationUtils from '@/utils/BinLocationUtils';

test.describe('Cancel qty in the middle of receipt', () => {
let STOCK_MOVEMENT: StockMovementResponse;
Expand Down Expand Up @@ -37,24 +39,41 @@ test.describe('Cancel qty in the middle of receipt', () => {
}
);

test.afterEach(async ({ stockMovementShowPage, stockMovementService }) => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
const isRollbackLastReceiptButtonVisible =
await stockMovementShowPage.rollbackLastReceiptButton.isVisible();
const isRollbackButtonVisible =
await stockMovementShowPage.rollbackButton.isVisible();

// due to failed test, shipment might not be received which will not show the button
if (isRollbackLastReceiptButtonVisible) {
await stockMovementShowPage.rollbackLastReceiptButton.click();
}

if (isRollbackButtonVisible) {
await stockMovementShowPage.rollbackButton.click();
test.afterEach(
async ({
stockMovementShowPage,
stockMovementService,
mainLocationService,
page,
locationListPage,
createLocationPage,
}) => {
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);
const receivingBin =
AppConfig.instance.receivingBinPrefix + STOCK_MOVEMENT.identifier;
await BinLocationUtils.deactivateReceivingBin({
mainLocationService,
locationListPage,
createLocationPage,
page,
receivingBin,
});
}

await stockMovementService.deleteStockMovement(STOCK_MOVEMENT.id);
});
);

test('Cancel remaining qty when receive item partially', async ({
stockMovementShowPage,
Expand Down
Loading
Loading