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
4 changes: 4 additions & 0 deletions src/pages/putaway/components/CompletePutawayTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class Row extends BasePageModel {
get putawayBin() {
return this.row.getByTestId('table-cell').nth(10);
}

get quantity() {
return this.row.getByTestId('table-cell').nth(7);
}
}

export default CompletePutawayTable;
4 changes: 4 additions & 0 deletions src/pages/putaway/steps/CompleteStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class CompleteStep extends BasePageModel {
exact: true,
});
}

get editButton() {
return this.page.getByTestId('edit-button').first();
}
}

export default CompleteStep;
7 changes: 5 additions & 2 deletions src/tests/putaway/assertAttemptToEditCompletedPutaway.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 RefreshCachesUtils from '@/utils/RefreshCaches';
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';

test.describe('Assert attempt to edit completed putaway', () => {
Expand Down Expand Up @@ -90,8 +91,10 @@ test.describe('Assert attempt to edit completed putaway', () => {
await test.step('Go to create putaway page', async () => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.isLoaded();
await navbar.profileButton.click();
await navbar.refreshCachesButton.click();
await RefreshCachesUtils.refreshCaches({
navbar,
page,
});
await navbar.inbound.click();
await navbar.createPutaway.click();
await createPutawayPage.isLoaded();
Expand Down
9 changes: 6 additions & 3 deletions src/tests/putaway/assertPutawayDetailsPage.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 RefreshCachesUtils from '@/utils/RefreshCaches';
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';

test.describe('Assert putaway details page', () => {
Expand Down Expand Up @@ -97,8 +98,10 @@ test.describe('Assert putaway details page', () => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.isLoaded();
await expect(stockMovementShowPage.statusTag).toHaveText('Received');
await navbar.profileButton.click();
await navbar.refreshCachesButton.click();
await RefreshCachesUtils.refreshCaches({
navbar,
page,
});
});

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

await test.step('Go to putaway view page and assert page elements', async () => {
const row = putawayListPage.table.row(1)
const row = putawayListPage.table.row(1);
await row.actionsButton.click();
await row.viewOrderDetails.click();
await putawayDetailsPage.isLoaded();
Expand Down
14 changes: 10 additions & 4 deletions src/tests/putaway/changeLocationOnCreatePutawayPage.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 RefreshCachesUtils from '@/utils/RefreshCaches';
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';

test.describe('Change location on putaway create page and list pages', () => {
Expand Down Expand Up @@ -76,6 +77,7 @@ test.describe('Change location on putaway create page and list pages', () => {
test('Change location on putaway create page and list page', async ({
stockMovementShowPage,
navbar,
page,
createPutawayPage,
locationChooser,
productService,
Expand All @@ -95,8 +97,10 @@ test.describe('Change location on putaway create page and list pages', () => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.isLoaded();
await expect(stockMovementShowPage.statusTag).toHaveText('Received');
await navbar.profileButton.click();
await navbar.refreshCachesButton.click();
await RefreshCachesUtils.refreshCaches({
navbar,
page,
});
});

await test.step('Go to create putaway page and assert its content', async () => {
Expand All @@ -120,8 +124,10 @@ test.describe('Change location on putaway create page and list pages', () => {
.getOrganization(depotLocation.organization?.name as string)
.click();
await locationChooser.getLocation(depotLocation.name).click();
await navbar.profileButton.click();
await navbar.refreshCachesButton.click();
await RefreshCachesUtils.refreshCaches({
navbar,
page,
});
await createPutawayPage.goToPage();
await expect(createPutawayPage.emptyCreatePageInformation).toBeVisible();
await expect(
Expand Down
10 changes: 7 additions & 3 deletions src/tests/putaway/createMoreThan1PutawayForTheSameItem.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 RefreshCachesUtils from '@/utils/RefreshCaches';
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';

test.describe('Create more than 1 putaway from the same item', () => {
Expand Down Expand Up @@ -81,6 +82,7 @@ test.describe('Create more than 1 putaway from the same item', () => {
test('Create more than 1 putaway from the same item', async ({
stockMovementShowPage,
navbar,
page,
createPutawayPage,
internalLocationService,
productShowPage,
Expand Down Expand Up @@ -143,7 +145,7 @@ test.describe('Create more than 1 putaway from the same item', () => {
await createPutawayPage.completeStep.isLoaded();
});

await test.step('Accept dialog and and complete putaway', async () => {
await test.step('Accept dialog and complete putaway', async () => {
await createPutawayPage.completeStep.isLoaded();
await createPutawayPage.completeStep.completePutawayButton.click();
await expect(
Expand All @@ -170,8 +172,10 @@ test.describe('Create more than 1 putaway from the same item', () => {
await expect(
productShowPage.inStockTabSection.row(1).quantityOnHand
).toHaveText('5');
await navbar.profileButton.click();
await navbar.refreshCachesButton.click();
await RefreshCachesUtils.refreshCaches({
navbar,
page,
});
});

await test.step('Go to create putaway page and assert receiving bin', async () => {
Expand Down
10 changes: 7 additions & 3 deletions src/tests/putaway/createPutaway.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 RefreshCachesUtils from '@/utils/RefreshCaches';
import { getShipmentId, getShipmentItemId } from '@/utils/shipmentUtils';

test.describe('Putaway received inbound shipment', () => {
Expand Down Expand Up @@ -81,6 +82,7 @@ test.describe('Putaway received inbound shipment', () => {
test('Create putaway from inbound stock movement', async ({
stockMovementShowPage,
navbar,
page,
createPutawayPage,
internalLocationService,
productShowPage,
Expand All @@ -91,8 +93,10 @@ test.describe('Putaway received inbound shipment', () => {
await stockMovementShowPage.goToPage(STOCK_MOVEMENT.id);
await stockMovementShowPage.isLoaded();
await expect(stockMovementShowPage.statusTag).toHaveText('Received');
await navbar.profileButton.click();
await navbar.refreshCachesButton.click();
await RefreshCachesUtils.refreshCaches({
navbar,
page,
});
});

await test.step('Go to create putaway page', async () => {
Expand Down Expand Up @@ -131,7 +135,7 @@ test.describe('Putaway received inbound shipment', () => {
await putawayDetailsPage.summaryTab.click();
productService.setProduct('5');
const product = await productService.getProduct();
await productShowPage.goToPage(product.id)
await productShowPage.goToPage(product.id);
await productShowPage.inStockTab.click();
await productShowPage.inStockTabSection.isLoaded();
const internalLocation = await internalLocationService.getLocation();
Expand Down
Loading
Loading