Skip to content

Commit

Permalink
Add some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nesrineabdmouleh committed May 27, 2024
1 parent be2e609 commit bf67813
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ export {default as boDashboardPage} from '@pages/BO/dashboard';
export {default as boOrdersPage} from '@pages/BO/orders';
export {default as boOrdersViewBasePage} from '@pages/BO/orders/view/viewOrderBasePage';
export {default as boOrdersViewProductsBlockPage} from '@pages/BO/orders/view/productsBlock';
export {default as boProductsPage} from '@pages/BO/catalog/products';
export {default as boAddProductPage} from '@pages/BO/catalog/products/add';
export {default as boAddProductCombinationsTabPage} from '@pages/BO/catalog/products/add/combinationsTab';
export {default as boAddProductDescriptionTabPage} from '@pages/BO/catalog/products/add/descriptionTab';
export {default as boAddProductDetailsTabPage} from '@pages/BO/catalog/products/add/detailsTab';
export {default as boAddProductOptionsTabPage} from '@pages/BO/catalog/products/add/optionsTab';
export {default as boAddProductPackTabPage} from '@pages/BO/catalog/products/add/packTab';
export {default as boAddProductPricingTabPage} from '@pages/BO/catalog/products/add/pricingTab';
export {default as boAddProductSEOTabPage} from '@pages/BO/catalog/products/add/seoTab';
export {default as boAddProductShippingTabPage} from '@pages/BO/catalog/products/add/shippingTab';
export {default as boAddProductStocksTabPage} from '@pages/BO/catalog/products/add/stocksTab';
export {default as boAddProductVirtualProductTabPage} from '@pages/BO/catalog/products/add/virtualProductTab';
export {default as boModuleManagerPage} from '@pages/BO/modules/moduleManager';
export {default as boModuleManagerUninstalledModulesPage} from '@pages/BO/modules/moduleManager/uninstalledModules';
export {default as boDesignPositionsPage} from '@pages/BO/design/positions/index';
Expand Down
1 change: 0 additions & 1 deletion src/interfaces/BO/catalog/products/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type ProductData from '@data/faker/product';
import type {ProductHeaderSummary} from '@data/types/product';

export interface BOCreateProductPageInterface extends BOBasePagePageInterface {
readonly saveProductButton: string;
readonly errorMessage: string;
readonly errorMessageWhenSummaryTooLong: (number: number) => string;
readonly pageTitle: string;
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/BO/catalog/products/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface BOProductsPageInterface extends BOBasePagePageInterface {
readonly alertDangerIDFilterValue: string;
readonly alertDangerPriceFilterValue: string;
readonly alertDangerQuantityFilterValue: string;
readonly modalCreateProduct: string;
readonly modalDialog: string;
readonly packOfProductsDescription: string;
readonly pageTitle: string;
readonly productWithCombinationsDescription: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class CombinationsTab extends BOBasePage implements BOCombinationsTabPageInterfa
// Bulk edit modal
this.bulkEditModal = '#bulk-combination-form-modal';
this.bulkEditModalTitle = `${this.bulkEditModal} .modal-header .modal-title`;
// Edit stocks
// Bulk edit stocks
this.bulkEditModalStocksButton = '#bulk_combination_stock_accordion_header h2 button';
this.bulkEditModalQuantitySwitchButton = (toEnable: number) => '#bulk_combination_stock_disabling_switch_delta_quantity_'
+ `${toEnable}`;
Expand All @@ -257,7 +257,7 @@ class CombinationsTab extends BOBasePage implements BOCombinationsTabPageInterfa
this.bulkEditModalImpactOnWeightSwitchButton = (toEnable: number) => '#bulk_combination_price_disabling_switch_weight_'
+ `${toEnable}`;
this.bulkEditModalImpactOnWeightInput = '#bulk_combination_price_weight';
// Edit specific references
// Bulk edit specific references
this.bulkEditModalSpecificReferences = '#bulk_combination_references_accordion_header h2 button';
this.bulkEditModalReferenceSwitchButton = (toEnable: number) => '#bulk_combination_references_disabling_switch_'
+ `reference_${toEnable}`;
Expand Down Expand Up @@ -620,7 +620,6 @@ class CombinationsTab extends BOBasePage implements BOCombinationsTabPageInterfa
combinationData.impactOnPriceTExc,
);
await this.setValue(combinationFrame!, this.editCombinationModalReferenceInput, combinationData.reference);

await this.waitForSelectorAndClick(page, this.editCombinationModalSaveButton);

return this.getAlertSuccessBlockParagraphContent(combinationFrame!);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BOBasePage from '@pages/BO/BOBasePage';
import type createProductPage from '@pages/BO/catalog/products/add';
import createProductPage from '@pages/BO/catalog/products/add';

// Import data
import type ProductData from '@data/faker/product';
Expand All @@ -9,7 +9,7 @@ import type {BODetailsTabPageInterface} from '@interfaces/BO/catalog/products/ad
import type {Frame, Page} from 'playwright';

/**
* Details tab on new product V2 page, contains functions that can be used on the page
* Details tab on new product page, contains functions that can be used on the page
* @class
* @extends BOBasePage
*/
Expand Down Expand Up @@ -225,7 +225,7 @@ class DetailsTab extends BOBasePage implements BODetailsTabPageInterface {
* @returns {Promise<string>}
*/
async getErrorMessageInReferencesForm(page: Page, inputNumber: number): Promise<string> {
await this.clickAndWaitForLoadState(page, createProductPage.saveProductButton);
await createProductPage.clickOnSaveProductButton(page);

return this.getTextContent(page, this.referenceFormErrorMessage(inputNumber));
}
Expand Down
8 changes: 4 additions & 4 deletions src/versions/develop/pages/BO/catalog/products/add/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BOBasePage from '@pages/BO/BOBasePage';

import virtualProductTab from '@pages/BO/catalog/products/add/virtualProductTab';
import productsPage from '@pages/BO/catalog/products';
import virtualProductTab from '@pages/BO/catalog/products/add/virtualProductTab';
import descriptionTab from '@pages/BO/catalog/products/add/descriptionTab';
import detailsTab from '@pages/BO/catalog/products/add/detailsTab';
import stocksTab from '@pages/BO/catalog/products/add/stocksTab';
Expand All @@ -15,11 +15,11 @@ import type {BOCreateProductPageInterface} from '@interfaces/BO/catalog/products
import type {Frame, Page} from 'playwright';

/**
* Create Product V2 page, contains functions that can be used on the page
* Create Product page, contains functions that can be used on the page
* @class
* @extends BOBasePage
*/
class CreateProduct extends BOBasePage implements BOCreateProductPageInterface {
class CreateProduct extends BOBasePage implements BOCreateProductPageInterface {

Check failure on line 22 in src/versions/develop/pages/BO/catalog/products/add/index.ts

View workflow job for this annotation

GitHub Actions / ESLint

Multiple spaces found before 'implements'
public readonly pageTitle: string;

public readonly saveAndPublishButtonName: string;
Expand Down Expand Up @@ -447,7 +447,7 @@ class CreateProduct extends BOBasePage implements BOCreateProductPageInterface {
await this.waitForVisibleSelector(page, this.deleteProductFooterModal);
await this.clickAndWaitForURL(page, this.deleteProductSubmitButton);

return productsPage.getAlertSuccessBlockParagraphContent(page);
return this.getAlertSuccessBlockParagraphContent(page);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {Page} from 'playwright';
import type {BOOptionsTabPageInterface} from '@interfaces/BO/catalog/products/add/optionsTab';

/**
* Options tab on new product V2 page, contains functions that can be used on the page
* Options tab on new product page, contains functions that can be used on the page
* @class
* @extends BOBasePage
*/
Expand Down
4 changes: 2 additions & 2 deletions src/versions/develop/pages/BO/catalog/products/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class ProductsPage extends BOBasePage implements BOProductsPageInterface {

private readonly productListTablePreviewButton: (row: number) => string;

readonly modalCreateProduct: string;
public readonly modalCreateProduct: string;

private readonly modalCreateProductLoader: string;

Expand All @@ -169,7 +169,7 @@ class ProductsPage extends BOBasePage implements BOProductsPageInterface {

private readonly productType: (type: string) => string;

protected readonly modalDialog: string;
public readonly modalDialog: string;

private readonly modalDialogFooter: string;

Expand Down

0 comments on commit bf67813

Please sign in to comment.