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 b54ef3b commit 53af928
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
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 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
10 changes: 5 additions & 5 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 {
public readonly pageTitle: string;

public readonly saveAndPublishButtonName: string;
Expand Down Expand Up @@ -360,7 +360,7 @@ class CreateProduct extends BOBasePage implements BOCreateProductPageInterface {
await detailsTab.setProductDetails(page, productData);

if (productData.type === 'virtual') {
await virtualProductTab.setVirtualProduct(page, productData);
await this.setVirtualProduct(page, productData);

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

View workflow job for this annotation

GitHub Actions / ESLint

Property 'setVirtualProduct' does not exist on type 'CreateProduct'.

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

View workflow job for this annotation

GitHub Actions / TypeScript Check

Property 'setVirtualProduct' does not exist on type 'CreateProduct'.
} else if (productData.type !== 'combinations') {
await stocksTab.setProductStock(page, productData);
}
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

0 comments on commit 53af928

Please sign in to comment.