Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring BO Products Create tabs #37

Merged
merged 1 commit into from
May 28, 2024
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
20 changes: 10 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ export {default as boOrdersViewBasePage} from '@pages/BO/orders/view/viewOrderBa
export {default as boOrdersViewProductsBlockPage} from '@pages/BO/orders/view/productsBlock';
export {default as boProductsPage} from '@pages/BO/catalog/products';
export {default as boProductsCreatePage} from '@pages/BO/catalog/products/create';
export {default as boProductsCreateTabCombinationsPage} from '@pages/BO/catalog/products/create/combinationsTab';
export {default as boProductsCreateTabDescriptionPage} from '@pages/BO/catalog/products/create/descriptionTab';
export {default as boProductsCreateTabDetailsPage} from '@pages/BO/catalog/products/create/detailsTab';
export {default as boProductsCreateTabOptionsPage} from '@pages/BO/catalog/products/create/optionsTab';
export {default as boProductsCreateTabPackPage} from '@pages/BO/catalog/products/create/packTab';
export {default as boProductsCreateTabPricingPage} from '@pages/BO/catalog/products/create/pricingTab';
export {default as boProductsCreateTabSEOPage} from '@pages/BO/catalog/products/create/seoTab';
export {default as boProductsCreateTabShippingPage} from '@pages/BO/catalog/products/create/shippingTab';
export {default as boProductsCreateTabStocksPage} from '@pages/BO/catalog/products/create/stocksTab';
export {default as boProductsCreateTabVirtualProductPage} from '@pages/BO/catalog/products/create/virtualProductTab';
export {default as boProductsCreateTabCombinationsPage} from '@pages/BO/catalog/products/create/tabCombinations';
export {default as boProductsCreateTabDescriptionPage} from '@pages/BO/catalog/products/create/tabDescription';
export {default as boProductsCreateTabDetailsPage} from '@pages/BO/catalog/products/create/tabDetails';
export {default as boProductsCreateTabOptionsPage} from '@pages/BO/catalog/products/create/tabOptions';
export {default as boProductsCreateTabPackPage} from '@pages/BO/catalog/products/create/tabPack';
export {default as boProductsCreateTabPricingPage} from '@pages/BO/catalog/products/create/tabPricing';
export {default as boProductsCreateTabSEOPage} from '@pages/BO/catalog/products/create/tabSeo';
export {default as boProductsCreateTabShippingPage} from '@pages/BO/catalog/products/create/tabShipping';
export {default as boProductsCreateTabStocksPage} from '@pages/BO/catalog/products/create/tabStocks';
export {default as boProductsCreateTabVirtualProductPage} from '@pages/BO/catalog/products/create/tabVirtualProduct';
// Export Pages FO
export * as FOBasePage from '@pages/FO/FOBasePage';
// Export Pages FO/Classic
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/BO/catalog/products/create/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {Page} from '@playwright/test';
import type FakerProduct from '@data/faker/product';
import type {ProductHeaderSummary} from '@data/types/product';

export interface BOCreateProductPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreatePageInterface extends BOBasePagePageInterface {
readonly errorMessage: string;
readonly errorMessageWhenSummaryTooLong: (number: number) => string;
readonly pageTitle: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ProductStockMovement,
} from '@data/types/product';

export interface BOCombinationsTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabCombinationsPageInterface extends BOBasePagePageInterface {
bulkEditRetailPrice(page: Frame | Page, editRetailPriceData: ProductCombinationBulkRetailPrice): Promise<void>;
bulkEditSpecificPrice(page: Frame|Page, specificReferencesData: ProductCombinationBulkSpecificReferences): Promise<void>;
bulkEditStock(page: Frame | Page, editStockData: ProductCombinationBulkStock): Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {Page} from '@playwright/test';
import type FakerProduct from '@data/faker/product';
import type {ProductImageInformation} from '@data/types/product';

export interface BODescriptionTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabDescriptionPageInterface extends BOBasePagePageInterface {
addNewCategory(page: Page, categories: string[]): Promise<void>;
addProductImages(page: Page, imagesPaths: any[]): Promise<void>;
addRelatedProduct(page: Page, productName: string): Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {Page} from '@playwright/test';
import type FakerProduct from '@data/faker/product';
import type {ProductFeatures} from '@data/types/product';

export interface BODetailsTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabDetailsPageInterface extends BOBasePagePageInterface {
addNewCustomizations(page: Page, productData: FakerProduct): Promise<void>;
addNewFile(page: Page, productData: FakerProduct): Promise<void>;
clickOnManageAllFiles(page: Page): Promise<Page>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {BOBasePagePageInterface} from '@interfaces/BO';

import type {Page} from '@playwright/test';

export interface BOOptionsTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabOptionsPageInterface extends BOBasePagePageInterface {
chooseSupplier(page: Page, supplierRow: number): Promise<void>;
getValue(page: Page, inputName: string): Promise<string>;
isDefaultSupplierSectionVisible(page: Page): Promise<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
ProductStockMovement,
} from '@data/types/product';

export interface BOPackTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabPackPageInterface extends BOBasePagePageInterface {
addProductToPack(page: Page, product: string, quantity: number): Promise<void>;
cancelDeleteProductFromPack(page: Page): Promise<void>;
confirmDeleteProductFromPack(page: Page): Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {Page} from '@playwright/test';
import FakerProduct from '@data/faker/product';
import type {ProductSpecificPrice} from '@data/types/product';

export interface BOPricingTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabPricingPageInterface extends BOBasePagePageInterface {
addEcoTax(page: Page, ecoTax: number): Promise<void>
clickOnAddSpecificPriceButton(page: Page): Promise<void>;
clickOnEditSpecificPriceIcon(page: Page, row: number): Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {BOBasePagePageInterface} from '@interfaces/BO';

import type {Page} from '@playwright/test';

export interface BOSeoTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabSeoPageInterface extends BOBasePagePageInterface {
clickOnGenerateUrlFromNameButton(page: Page): Promise<void>;
getErrorMessageOfFriendlyUrl(page: Page): Promise<string>;
getValue(page: Page, inputName: string, languageId?: string): Promise<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {Page} from '@playwright/test';

import type FakerProduct from '@data/faker/product';

export interface BOShippingTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabShippingPageInterface extends BOBasePagePageInterface {
clickOnEditDeliveryTimeLink(page: Page): Promise<Page>;
getValue(page: Page, inputName: string, languageId?: string): Promise<string>;
selectAvailableCarrier(page: Page, carrier: string): Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {ProductStockMovement} from '@data/types/product';

import type {Page} from '@playwright/test';

export interface BOStocksTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabStocksPageInterface extends BOBasePagePageInterface {
clickViewAllStockMovements(page: Page): Promise<Page>;
getProductQuantity(page: Page): Promise<number>;
getStockMovement(page: Page, movementRow: number): Promise<ProductStockMovement>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {Page} from '@playwright/test';

import type FakerProduct from '@data/faker/product';

export interface BOVirtualProductTabPageInterface extends BOBasePagePageInterface {
export interface BOProductsCreateTabVirtualProductPageInterface extends BOBasePagePageInterface {
clickOnEditDefaultBehaviourLink(page: Page): Promise<Page>;
getErrorMessageInDownloadFileInput(page: Page): Promise<string>;
setLabelWhenInStock(page: Page, label: string): Promise<void>;
Expand Down
16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/combinationsTab.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/descriptionTab.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/detailsTab.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/pages/BO/catalog/products/create/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type {BOCreateProductPageInterface} from '@interfaces/BO/catalog/products/create';
import type {BOProductsCreatePageInterface} from '@interfaces/BO/catalog/products/create';
import testContext from '@utils/test';
import semver from 'semver';

const psVersion = testContext.getPSVersion();

/* eslint-disable global-require */
function requirePage(): BOCreateProductPageInterface {
function requirePage(): BOProductsCreatePageInterface {
if (semver.gte(psVersion, '0.0.0')) {
return require('@versions/develop/pages/BO/catalog/products/create');
}
Expand Down
16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/optionsTab.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/packTab.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/pricingTab.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/seoTab.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/shippingTab.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/pages/BO/catalog/products/create/stocksTab.ts

This file was deleted.

9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabCombinations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {type BOProductsCreateTabCombinationsPageInterface} from '@interfaces/BO/catalog/products/create/tabCombinations';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabCombinationsPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabCombinations');
}
/* eslint-enable global-require */

export default requirePage();
9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabDescription.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {BOProductsCreateTabDescriptionPageInterface} from '@interfaces/BO/catalog/products/create/tabDescription';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabDescriptionPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabDescription');
}
/* eslint-enable global-require */

export default requirePage();
8 changes: 8 additions & 0 deletions src/pages/BO/catalog/products/create/tabDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type {BOProductsCreateTabDetailsPageInterface} from '@interfaces/BO/catalog/products/create/tabDetails';
/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabDetailsPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabDetails');
}
/* eslint-enable global-require */

export default requirePage();
9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabOptions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {BOProductsCreateTabOptionsPageInterface} from '@interfaces/BO/catalog/products/create/tabOptions';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabOptionsPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabOptions');
}
/* eslint-enable global-require */

export default requirePage();
9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabPack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {BOProductsCreateTabPackPageInterface} from '@interfaces/BO/catalog/products/create/tabPack';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabPackPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabPack');
}
/* eslint-enable global-require */

export default requirePage();
9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabPricing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {BOProductsCreateTabPricingPageInterface} from '@interfaces/BO/catalog/products/create/tabPricing';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabPricingPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabPricing');
}
/* eslint-enable global-require */

export default requirePage();
9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabSeo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {BOProductsCreateTabSeoPageInterface} from '@interfaces/BO/catalog/products/create/tabSeo';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabSeoPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabSeo');
}
/* eslint-enable global-require */

export default requirePage();
9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabShipping.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {BOProductsCreateTabShippingPageInterface} from '@interfaces/BO/catalog/products/create/tabShipping';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabShippingPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabShipping');
}
/* eslint-enable global-require */

export default requirePage();
9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabStocks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {BOProductsCreateTabStocksPageInterface} from '@interfaces/BO/catalog/products/create/tabStocks';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabStocksPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabStocks');
}
/* eslint-enable global-require */

export default requirePage();
9 changes: 9 additions & 0 deletions src/pages/BO/catalog/products/create/tabVirtualProduct.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {BOProductsCreateTabVirtualProductPageInterface} from '@interfaces/BO/catalog/products/create/tabVirtualProduct';

/* eslint-disable global-require */
function requirePage(): BOProductsCreateTabVirtualProductPageInterface {
return require('@versions/develop/pages/BO/catalog/products/create/tabVirtualProduct');
}
/* eslint-enable global-require */

export default requirePage();
Loading
Loading