From a3eb6d0b4200b7800564f67641d0d76c056c1e71 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 20 Sep 2024 17:37:25 +0200 Subject: [PATCH 1/3] Functional Tests : BO - Shop Parameters - Product Settings : Display notifications --- ...or.ts => 04_separatorOfAttributeAnchor.ts} | 19 ++- ...dPrice.ts => 05_displayDiscountedPrice.ts} | 24 ++-- .../02_productPage/06_displayNotifications.ts | 127 ++++++++++++++++++ 3 files changed, 147 insertions(+), 23 deletions(-) rename tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/{03_separatorOfAttributeAnchor.ts => 04_separatorOfAttributeAnchor.ts} (85%) rename tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/{04_displayDiscountedPrice.ts => 05_displayDiscountedPrice.ts} (90%) create mode 100644 tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/06_displayNotifications.ts diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/03_separatorOfAttributeAnchor.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/04_separatorOfAttributeAnchor.ts similarity index 85% rename from tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/03_separatorOfAttributeAnchor.ts rename to tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/04_separatorOfAttributeAnchor.ts index a2c61e6620112..b9f28048611a1 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/03_separatorOfAttributeAnchor.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/04_separatorOfAttributeAnchor.ts @@ -4,14 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, dataProducts, foClassicHomePage, foClassicProductPage, @@ -51,8 +48,8 @@ describe('BO - Shop Parameters - Product Settings : Update separator of attribut boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -64,17 +61,17 @@ describe('BO - Shop Parameters - Product Settings : Update separator of attribut it(`should choose the separator option '${test.args.option}'`, async function () { await testContext.addContextItem(this, 'testIdentifier', `chooseOption_${index}`, baseContext); - const result = await productSettingsPage.setSeparatorOfAttributeOnProductLink( + const result = await boProductSettingsPage.setSeparatorOfAttributeOnProductLink( page, test.args.option, ); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const isHomePage = await foClassicHomePage.isHomePage(page); @@ -103,8 +100,8 @@ describe('BO - Shop Parameters - Product Settings : Update separator of attribut page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/04_displayDiscountedPrice.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/05_displayDiscountedPrice.ts similarity index 90% rename from tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/04_displayDiscountedPrice.ts rename to tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/05_displayDiscountedPrice.ts index 8417b550832f2..7f76cfc26f9fb 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/04_displayDiscountedPrice.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/05_displayDiscountedPrice.ts @@ -6,7 +6,6 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import pages // Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import cartRulesPage from '@pages/BO/catalog/discounts'; import catalogPriceRulesPage from '@pages/BO/catalog/discounts/catalogPriceRules'; import addCatalogPriceRulePage from '@pages/BO/catalog/discounts/catalogPriceRules/add'; @@ -15,6 +14,7 @@ import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, dataProducts, FakerCatalogPriceRule, foClassicHomePage, @@ -98,10 +98,10 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable display disco addCatalogPriceRulePage.shopParametersParentLink, addCatalogPriceRulePage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -126,17 +126,17 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable display disco baseContext, ); - const result = await productSettingsPage.setDisplayDiscountedPriceStatus( + const result = await boProductSettingsPage.setDisplayDiscountedPriceStatus( page, test.args.enable, ); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const isHomePage = await foClassicHomePage.isHomePage(page); @@ -167,18 +167,18 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable display disco page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); it('should go to \'Catalog > Discounts\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToDiscountsPageToDeletePriceRule', baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.discountsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.discountsLink, ); const pageTitle = await cartRulesPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/06_displayNotifications.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/06_displayNotifications.ts new file mode 100644 index 0000000000000..104d56e9e8294 --- /dev/null +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/06_displayNotifications.ts @@ -0,0 +1,127 @@ +// Import utils +import testContext from '@utils/testContext'; + +// Import commonTests +import loginCommon from '@commonTests/BO/loginBO'; + +import {expect} from 'chai'; +import type {BrowserContext, Page} from 'playwright'; +import { + boDashboardPage, + boProductSettingsPage, + dataProducts, + foClassicHomePage, + foClassicProductPage, + foClassicSearchResultsPage, + utilsPlaywright, +} from '@prestashop-core/ui-testing'; + +const baseContext: string = 'functional_BO_shopParameters_productSettings_productPage_displayNotifications'; + +describe('BO - Shop Parameters - Product Settings : Display notifications', async () => { + let browserContext: BrowserContext; + let page: Page; + + before(async function () { + browserContext = await utilsPlaywright.createBrowserContext(this.browser); + page = await utilsPlaywright.newTab(browserContext); + }); + + after(async () => { + await utilsPlaywright.closeBrowserContext(browserContext); + }); + + it('should login in BO', async function () { + await loginCommon.loginBO(this, page); + }); + + it('should go to \'Shop parameters > Product Settings\' page', async function () { + await testContext.addContextItem(this, 'testIdentifier', 'goToProductSettingsPage', baseContext); + + await boDashboardPage.goToSubMenu( + page, + boDashboardPage.shopParametersParentLink, + boDashboardPage.productSettingsLink, + ); + await boProductSettingsPage.closeSfToolBar(page); + + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); + + const isChecked = await boProductSettingsPage.isDisplayNotificationIfProductInCartChecked(page); + expect(isChecked).to.equals(true); + }); + + it('should view my shop', async function () { + await testContext.addContextItem(this, 'testIdentifier', `viewMyShop`, baseContext); + + page = await boProductSettingsPage.viewMyShop(page); + await foClassicHomePage.changeLanguage(page, 'en'); + + const isHomePage = await foClassicHomePage.isHomePage(page); + expect(isHomePage, 'Home page was not opened').to.eq(true); + }); + + it('should search product', async function () { + await testContext.addContextItem(this, 'testIdentifier', 'searchProduct', baseContext); + + await foClassicHomePage.searchProduct(page, dataProducts.demo_11.name); + + const pageTitle = await foClassicSearchResultsPage.getPageTitle(page); + expect(pageTitle).to.equal(foClassicSearchResultsPage.pageTitle); + }); + + it('should add the product to cart', async function () { + await testContext.addContextItem(this, 'testIdentifier', 'addProductToCart', baseContext); + + await foClassicSearchResultsPage.goToProductPage(page, 1); + // Add the product to the cart + await foClassicProductPage.addProductToTheCart(page, 1, [], false); + + const notificationsNumber = await foClassicProductPage.getCartNotificationsNumber(page); + expect(notificationsNumber).to.be.equal(1); + + const hasNotificationMessage = await foClassicProductPage.hasNotificationMessage(page); + expect(hasNotificationMessage).to.equals(false); + }); + + it('should check, on front office, the notification', async function () { + await testContext.addContextItem(this, 'testIdentifier', 'checkFrontOfficeEnabked', baseContext); + + await foClassicSearchResultsPage.reloadPage(page); + + const hasNotificationMessage = await foClassicProductPage.hasNotificationMessage(page); + expect(hasNotificationMessage).to.equals(true); + + const notificationMessage = await foClassicProductPage.getNotificationMessage(page); + expect(notificationMessage).to.equals(foClassicProductPage.messageCartContainsAlreadyProducts); + }); + + it('should go to \'Shop parameters > Product Settings\' page', async function () { + await testContext.addContextItem(this, 'testIdentifier', 'disableConfiguration', baseContext); + + page = await foClassicProductPage.changePage(browserContext, 0); + + const result = await boProductSettingsPage.setDisplayNotificationIfProductInCartStatus(page, false); + expect(result).to.equals(boProductSettingsPage.successfulUpdateMessage); + }); + + it('should check, on front office, the notification', async function () { + await testContext.addContextItem(this, 'testIdentifier', 'checkFrontOfficeDisabled', baseContext); + + page = await boProductSettingsPage.changePage(browserContext, 1); + await foClassicProductPage.reloadPage(page); + + const hasNotificationMessage = await foClassicProductPage.hasNotificationMessage(page); + expect(hasNotificationMessage).to.equals(false); + }); + + it('should reset the configuration', async function () { + await testContext.addContextItem(this, 'testIdentifier', 'resetConfiguration', baseContext); + + page = await foClassicProductPage.changePage(browserContext, 0); + + const result = await boProductSettingsPage.setDisplayNotificationIfProductInCartStatus(page, true); + expect(result).to.equals(boProductSettingsPage.successfulUpdateMessage); + }); +}); From 9650af967e869243af8c69ec0df00ccc22144fc2 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 20 Sep 2024 17:40:31 +0200 Subject: [PATCH 2/3] Migrate `@pages/BO/shopParameters/productSettings` into `ui-testing-library` --- .../01_products/11_combinationTab.ts | 12 +- .../03_catalog/01_products/13_virtualTab.ts | 8 +- .../03_catalog/01_products/16_shippingTab.ts | 8 +- .../01_productsGeneral/01_catalogMode.ts | 31 +- .../01_productsGeneral/02_newDaysNumber.ts | 21 +- .../03_maxSizeShortDescription.ts | 18 +- .../04_quantityDiscountsBasedOn.ts | 38 +- .../05_forceUpdateFriendlyURL.ts | 16 +- .../06_defaultActivationStatus.ts | 18 +- .../01_displayAvailableQuantities.ts | 21 +- .../02_displayAddToCartButton.ts | 21 +- .../02_productPage/06_displayNotifications.ts | 2 +- .../01_enableStockManagement.ts | 16 +- .../02_defaultPackStockManagement.ts | 22 +- .../03_displayUnavailableProductAttributes.ts | 22 +- .../04_displayRemainingQuantities.ts | 16 +- .../05_allowOrderingOutOfStock.ts | 22 +- .../06_labelOfInStockProducts.ts | 19 +- .../03_productsStock/07_labelOutOfStock.ts | 28 +- .../08_enableDeliveryTimeOfInStockProducts.ts | 19 +- ..._enableDeliveryTimeOfOutOfStockProducts.ts | 24 +- .../01_updateNumberOfProductsPerPage.ts | 21 +- .../02_updateDefaultProductsOrder.ts | 21 +- .../02_sortAndFilter/01_sortProducts.ts | 22 +- .../02_sortAndFilter/02_filterProducts.ts | 22 +- .../02_sortAndFilter/03_clearOneFilter.ts | 6 +- .../03_navigationAndDisplay/01_displayTags.ts | 18 +- .../03_navigationAndDisplay/02_pagination.ts | 32 +- .../02_sortAndFilter/01_sortProducts.ts | 22 +- .../02_sortAndFilter/02_filterProducts.ts | 22 +- .../02_sortAndFilter/03_clearFilters.ts | 6 +- .../03_navigationAndDisplay/01_displayTags.ts | 18 +- .../03_navigationAndDisplay/02_pagination.ts | 32 +- .../shopParameters/productSettings/index.ts | 478 ------------------ 34 files changed, 302 insertions(+), 820 deletions(-) delete mode 100644 tests/UI/pages/BO/shopParameters/productSettings/index.ts diff --git a/tests/UI/campaigns/functional/BO/03_catalog/01_products/11_combinationTab.ts b/tests/UI/campaigns/functional/BO/03_catalog/01_products/11_combinationTab.ts index 8a564d3dd182d..e3df858074fdc 100644 --- a/tests/UI/campaigns/functional/BO/03_catalog/01_products/11_combinationTab.ts +++ b/tests/UI/campaigns/functional/BO/03_catalog/01_products/11_combinationTab.ts @@ -8,13 +8,13 @@ import loginCommon from '@commonTests/BO/loginBO'; import createProductsPage from '@pages/BO/catalog/products/add'; import combinationsTab from '@pages/BO/catalog/products/add/combinationsTab'; import attributesPage from '@pages/BO/catalog/attributes'; -import productSettings from '@pages/BO/shopParameters/productSettings'; import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, foClassicProductPage, type ProductAttribute, @@ -284,14 +284,14 @@ describe('BO - Catalog - Products : Combination tab', async () => { page = await combinationsTab.clickOnEditDefaultBehaviourLink(page); - const pageTitle = await productSettings.getPageTitle(page); - expect(pageTitle).to.contains(productSettings.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should close the page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goBackToBO3', baseContext); - page = await productSettings.closePage(browserContext, page, 0); + page = await boProductSettingsPage.closePage(browserContext, page, 0); const pageTitle = await createProductsPage.getPageTitle(page); expect(pageTitle).to.contains(createProductsPage.pageTitle); @@ -344,7 +344,7 @@ describe('BO - Catalog - Products : Combination tab', async () => { it('should close the page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goBackToBO4', baseContext); - page = await productSettings.closePage(browserContext, page, 0); + page = await boProductSettingsPage.closePage(browserContext, page, 0); const pageTitle = await createProductsPage.getPageTitle(page); expect(pageTitle).to.contains(createProductsPage.pageTitle); @@ -402,7 +402,7 @@ describe('BO - Catalog - Products : Combination tab', async () => { it('should close the page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goBackToBO5', baseContext); - page = await productSettings.closePage(browserContext, page, 0); + page = await boProductSettingsPage.closePage(browserContext, page, 0); const pageTitle = await createProductsPage.getPageTitle(page); expect(pageTitle).to.contains(createProductsPage.pageTitle); diff --git a/tests/UI/campaigns/functional/BO/03_catalog/01_products/13_virtualTab.ts b/tests/UI/campaigns/functional/BO/03_catalog/01_products/13_virtualTab.ts index d9b71a9d75d79..91a9a078e2f83 100644 --- a/tests/UI/campaigns/functional/BO/03_catalog/01_products/13_virtualTab.ts +++ b/tests/UI/campaigns/functional/BO/03_catalog/01_products/13_virtualTab.ts @@ -7,7 +7,6 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import BO pages import createProductsPage from '@pages/BO/catalog/products/add'; import virtualProductTab from '@pages/BO/catalog/products/add/virtualProductTab'; -import productSettings from '@pages/BO/shopParameters/productSettings'; // Import FO pages import {orderHistoryPage} from '@pages/FO/classic/myAccount/orderHistory'; @@ -16,6 +15,7 @@ import {orderDetailsPage} from '@pages/FO/classic/myAccount/orderDetails'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, dataCustomers, dataPaymentMethods, FakerProduct, @@ -273,14 +273,14 @@ describe('BO - Catalog - Products : Virtual tab', async () => { page = await virtualProductTab.clickOnEditDefaultBehaviourLink(page); - const pageTitle = await productSettings.getPageTitle(page); - expect(pageTitle).to.contains(productSettings.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should close the page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goBackToBO3', baseContext); - page = await productSettings.closePage(browserContext, page, 0); + page = await boProductSettingsPage.closePage(browserContext, page, 0); const pageTitle = await createProductsPage.getPageTitle(page); expect(pageTitle).to.contains(createProductsPage.pageTitle); diff --git a/tests/UI/campaigns/functional/BO/03_catalog/01_products/16_shippingTab.ts b/tests/UI/campaigns/functional/BO/03_catalog/01_products/16_shippingTab.ts index 63654e4936fa8..330b7c6e1317c 100644 --- a/tests/UI/campaigns/functional/BO/03_catalog/01_products/16_shippingTab.ts +++ b/tests/UI/campaigns/functional/BO/03_catalog/01_products/16_shippingTab.ts @@ -6,13 +6,13 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import BO pages import createProductPage from '@pages/BO/catalog/products/add'; -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import { boDashboardPage, boProductsPage, boProductsCreateTabShippingPage, boProductsCreateTabStocksPage, + boProductSettingsPage, dataCarriers, dataCustomers, FakerProduct, @@ -191,14 +191,14 @@ describe('BO - Catalog - Products : Shipping tab', async () => { page = await boProductsCreateTabShippingPage.clickOnEditDeliveryTimeLink(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should go back to BO', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goBackToBO2', baseContext); - page = await productSettingsPage.closePage(browserContext, page, 0); + page = await boProductSettingsPage.closePage(browserContext, page, 0); const pageTitle = await createProductPage.getPageTitle(page); expect(pageTitle).to.contains(createProductPage.pageTitle); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/01_catalogMode.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/01_catalogMode.ts index 086c78bd26e4b..3900906c85960 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/01_catalogMode.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/01_catalogMode.ts @@ -4,14 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, dataProducts, foClassicHomePage, foClassicProductPage, @@ -53,10 +50,10 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable catalog mode' boDashboardPage.shopParametersParentLink, boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -73,8 +70,8 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable catalog mode' baseContext, ); - const result = await productSettingsPage.changeCatalogModeStatus(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.changeCatalogModeStatus(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); if (test.args.enable) { @@ -102,14 +99,14 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable catalog mode' baseContext, ); - const result = await productSettingsPage.setShowPricesStatus(page, showPrices.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setShowPricesStatus(page, showPrices.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const isHomePage = await foClassicHomePage.isHomePage(page); @@ -147,15 +144,15 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable catalog mode' page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); } else { it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', 'viewMyShop', baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const isHomePage = await foClassicHomePage.isHomePage(page); @@ -193,8 +190,8 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable catalog mode' page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); } }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/02_newDaysNumber.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/02_newDaysNumber.ts index 9e7c9bc6fde8e..e83178b5160f8 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/02_newDaysNumber.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/02_newDaysNumber.ts @@ -4,14 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, foClassicHomePage, utilsPlaywright, } from '@prestashop-core/ui-testing'; @@ -51,10 +48,10 @@ describe('BO - Shop Parameters - Product Settings : Update Number of days for wh boDashboardPage.shopParametersParentLink, boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -66,14 +63,14 @@ describe('BO - Shop Parameters - Product Settings : Update Number of days for wh it(`should update Number of days to ${test.args.value}`, async function () { await testContext.addContextItem(this, 'testIdentifier', `updateNumberOfDaysTo${test.args.value}`, baseContext); - const result = await productSettingsPage.updateNumberOfDays(page, test.args.value); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.updateNumberOfDays(page, test.args.value); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${test.args.state}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const isHomePage = await foClassicHomePage.isHomePage(page); @@ -92,8 +89,8 @@ describe('BO - Shop Parameters - Product Settings : Update Number of days for wh page = await foClassicHomePage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/03_maxSizeShortDescription.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/03_maxSizeShortDescription.ts index 2dde316869bc2..3a71a08a8890c 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/03_maxSizeShortDescription.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/03_maxSizeShortDescription.ts @@ -5,7 +5,6 @@ import testContext from '@utils/testContext'; import loginCommon from '@commonTests/BO/loginBO'; // Import pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import addProductPage from '@pages/BO/catalog/products/add'; import descriptionTab from '@pages/BO/catalog/products/add/descriptionTab'; @@ -14,6 +13,7 @@ import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, utilsPlaywright, } from '@prestashop-core/ui-testing'; @@ -63,26 +63,26 @@ describe('BO - Shop Parameters - Product Settings : Update max size of short des boDashboardPage.shopParametersParentLink, boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it(`should update max size of short description to ${test.args.descriptionSize}`, async function () { await testContext.addContextItem(this, 'testIdentifier', `updateMaxSizeSummaryValue${index}`, baseContext); - const result = await productSettingsPage.UpdateMaxSizeOfSummary(page, test.args.descriptionSize); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setMaxSizeOfSummaryValue(page, test.args.descriptionSize); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', `goToCatalogProductsPage${index}`, baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/04_quantityDiscountsBasedOn.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/04_quantityDiscountsBasedOn.ts index 27d26c6ee41b9..2faf1ec6c5ebc 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/04_quantityDiscountsBasedOn.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/04_quantityDiscountsBasedOn.ts @@ -9,13 +9,13 @@ import loginCommon from '@commonTests/BO/loginBO'; import addProductPage from '@pages/BO/catalog/products/add'; import pricingTab from '@pages/BO/catalog/products/add/pricingTab'; import combinationsTab from '@pages/BO/catalog/products/add/combinationsTab'; -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, foClassicCartPage, foClassicProductPage, @@ -106,26 +106,26 @@ describe('BO - Shop Parameters - Product Settings : Choose quantity discount bas boDashboardPage.shopParametersParentLink, boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should choose quantity discounts based on \'Products\'', async function () { await testContext.addContextItem(this, 'testIdentifier', 'chooseQuantityDiscountsBasedOnProducts', baseContext); - const result = await productSettingsPage.chooseQuantityDiscountsBasedOn(page, 'Products'); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.chooseQuantityDiscountsBasedOn(page, 'Products'); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToProductsPage', baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); await boProductsPage.closeSfToolBar(page); @@ -218,21 +218,21 @@ describe('BO - Shop Parameters - Product Settings : Choose quantity discount bas addProductPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should choose quantity discounts based on \'Combinations\'', async function () { await testContext.addContextItem(this, 'testIdentifier', 'chooseQuantityDiscountsBasedOnCombinations', baseContext); - const result = await productSettingsPage.chooseQuantityDiscountsBasedOn(page, 'Combinations'); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.chooseQuantityDiscountsBasedOn(page, 'Combinations'); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop and check ATI price in FO', async function () { await testContext.addContextItem(this, 'testIdentifier', 'ViewMyShopAndCheckPriceATI', baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicProductPage.goToCartPage(page); const priceATI = await foClassicCartPage.getATIPrice(page); @@ -244,17 +244,17 @@ describe('BO - Shop Parameters - Product Settings : Choose quantity discount bas page = await foClassicCartPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToProductsPageToDeleteProduct', baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/05_forceUpdateFriendlyURL.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/05_forceUpdateFriendlyURL.ts index 6f9cbe65b2592..10708019cb15c 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/05_forceUpdateFriendlyURL.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/05_forceUpdateFriendlyURL.ts @@ -7,13 +7,13 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import pages import addProductPage from '@pages/BO/catalog/products/add'; import seoTab from '@pages/BO/catalog/products/add/seoTab'; -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, utilsPlaywright, } from '@prestashop-core/ui-testing'; @@ -124,8 +124,8 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable force update addProductPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it(`should ${test.args.action} force update friendly URL`, async function () { @@ -135,17 +135,17 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable force update baseContext, ); - const result = await productSettingsPage.setForceUpdateFriendlyURLStatus(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setForceUpdateFriendlyURLStatus(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', `goToProductsPage${index}`, baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/06_defaultActivationStatus.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/06_defaultActivationStatus.ts index b6718e0f133d8..f9bd1e209a842 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/06_defaultActivationStatus.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/01_productsGeneral/06_defaultActivationStatus.ts @@ -5,7 +5,6 @@ import testContext from '@utils/testContext'; import loginCommon from '@commonTests/BO/loginBO'; // Import pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import addProductPage from '@pages/BO/catalog/products/add'; import {expect} from 'chai'; @@ -13,6 +12,7 @@ import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, utilsPlaywright, } from '@prestashop-core/ui-testing'; @@ -57,10 +57,10 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable default activ boDashboardPage.shopParametersParentLink, boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it(`should ${test.args.action} default activation status`, async function () { @@ -71,17 +71,17 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable default activ baseContext, ); - const result = await productSettingsPage.setDefaultActivationStatus(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setDefaultActivationStatus(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', `goToProductsPage${index}`, baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/01_displayAvailableQuantities.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/01_displayAvailableQuantities.ts index d2ef8b0667334..0a28c9b5bd9d7 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/01_displayAvailableQuantities.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/01_displayAvailableQuantities.ts @@ -4,14 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, dataProducts, foClassicHomePage, foClassicProductPage, @@ -53,10 +50,10 @@ describe('BO - Shop Parameters - Product Settings : Display available quantities boDashboardPage.shopParametersParentLink, boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -72,14 +69,14 @@ describe('BO - Shop Parameters - Product Settings : Display available quantities baseContext, ); - const result = await productSettingsPage.setDisplayAvailableQuantitiesStatus(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setDisplayAvailableQuantitiesStatus(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); const isHomePage = await foClassicHomePage.isHomePage(page); expect(isHomePage, 'Home page was not opened').to.eq(true); @@ -106,8 +103,8 @@ describe('BO - Shop Parameters - Product Settings : Display available quantities page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/02_displayAddToCartButton.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/02_displayAddToCartButton.ts index c93842fea00ce..2e738d8649f47 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/02_displayAddToCartButton.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/02_displayAddToCartButton.ts @@ -5,14 +5,11 @@ import testContext from '@utils/testContext'; import loginCommon from '@commonTests/BO/loginBO'; import {enableHummingbird, disableHummingbird} from '@commonTests/BO/design/hummingbird'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, foHummingbirdHomePage, utilsPlaywright, } from '@prestashop-core/ui-testing'; @@ -49,10 +46,10 @@ describe('BO - Shop Parameters - Product Settings : Display add to cart button w boDashboardPage.shopParametersParentLink, boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -64,14 +61,14 @@ describe('BO - Shop Parameters - Product Settings : Display add to cart button w it(`should ${test.args.action} Add to cart button when product has attributes`, async function () { await testContext.addContextItem(this, 'testIdentifier', `${test.args.action}DisplayAddToCartButton`, baseContext); - const result = await productSettingsPage.setDisplayAddToCartButton(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setDisplayAddToCartButton(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); const isHomePage = await foHummingbirdHomePage.isHomePage(page); expect(isHomePage, 'Home page was not opened').to.eq(true); @@ -96,8 +93,8 @@ describe('BO - Shop Parameters - Product Settings : Display add to cart button w page = await foHummingbirdHomePage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/06_displayNotifications.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/06_displayNotifications.ts index 104d56e9e8294..a6b1d0239be46 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/06_displayNotifications.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/02_productPage/06_displayNotifications.ts @@ -53,7 +53,7 @@ describe('BO - Shop Parameters - Product Settings : Display notifications', asyn }); it('should view my shop', async function () { - await testContext.addContextItem(this, 'testIdentifier', `viewMyShop`, baseContext); + await testContext.addContextItem(this, 'testIdentifier', 'viewMyShop', baseContext); page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/01_enableStockManagement.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/01_enableStockManagement.ts index 40f2dde4813ae..98142d966c1af 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/01_enableStockManagement.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/01_enableStockManagement.ts @@ -6,7 +6,6 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import pages import addProductPage from '@pages/BO/catalog/products/add'; -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; @@ -14,6 +13,7 @@ import { boDashboardPage, boProductsPage, boProductsCreateTabStocksPage, + boProductSettingsPage, utilsPlaywright, } from '@prestashop-core/ui-testing'; @@ -53,24 +53,24 @@ describe('BO - Shop Parameters - Product Settings : Enable/Disable stock managem boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it(`should ${test.args.action} stock management`, async function () { await testContext.addContextItem(this, 'testIdentifier', `${test.args.action}StockManagement`, baseContext); - const result = await productSettingsPage.setEnableStockManagementStatus(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setEnableStockManagementStatus(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', `goToProductsPage${index}`, baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); await boProductsPage.closeSfToolBar(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/02_defaultPackStockManagement.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/02_defaultPackStockManagement.ts index 5c4cbb4f79fcc..e0cac6e37c029 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/02_defaultPackStockManagement.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/02_defaultPackStockManagement.ts @@ -5,12 +5,12 @@ import testContext from '@utils/testContext'; import loginCommon from '@commonTests/BO/loginBO'; // Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import addProductPage from '@pages/BO/catalog/products/add'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, dataCustomers, dataPaymentMethods, FakerProduct, @@ -150,21 +150,21 @@ describe('BO - Shop Parameters - Product Settings : Default pack stock managemen addProductPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it(`should choose the Default pack stock management '${test.args.option}'`, async function () { await testContext.addContextItem(this, 'testIdentifier', `stockManagementOption${index}`, baseContext); - const result = await productSettingsPage.setDefaultPackStockManagement(page, test.args.option); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setDefaultPackStockManagement(page, test.args.option); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const isFoHomePage = await foClassicHomePage.isHomePage(page); @@ -261,8 +261,8 @@ describe('BO - Shop Parameters - Product Settings : Default pack stock managemen page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should go to \'Catalog > Products\' page', async function () { @@ -315,10 +315,10 @@ describe('BO - Shop Parameters - Product Settings : Default pack stock managemen it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToProductsPageToDeleteProduct', baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/03_displayUnavailableProductAttributes.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/03_displayUnavailableProductAttributes.ts index 00dddd56f7428..850e8b7038e17 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/03_displayUnavailableProductAttributes.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/03_displayUnavailableProductAttributes.ts @@ -8,13 +8,13 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import BO pages import addProductPage from '@pages/BO/catalog/products/add'; import combinationsTab from '@pages/BO/catalog/products/add/combinationsTab'; -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, foClassicHomePage, foClassicProductPage, @@ -132,8 +132,8 @@ describe('BO - Shop Parameters - Product Settings : Display unavailable product addProductPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -149,14 +149,14 @@ describe('BO - Shop Parameters - Product Settings : Display unavailable product baseContext, ); - const result = await productSettingsPage.setDisplayUnavailableProductAttributesStatus(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setDisplayUnavailableProductAttributesStatus(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const isHomePage = await foClassicHomePage.isHomePage(page); @@ -194,18 +194,18 @@ describe('BO - Shop Parameters - Product Settings : Display unavailable product page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToProductsPageToDeleteProduct', baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/04_displayRemainingQuantities.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/04_displayRemainingQuantities.ts index 36723802eaa03..9c61830943379 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/04_displayRemainingQuantities.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/04_displayRemainingQuantities.ts @@ -6,7 +6,6 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import pages // Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import addProductPage from '@pages/BO/catalog/products/add'; import {expect} from 'chai'; @@ -14,6 +13,7 @@ import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, foClassicHomePage, foClassicProductPage, @@ -109,8 +109,8 @@ describe('BO - Shop Parameters - Product Settings : Display remaining quantities addProductPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); [ @@ -120,14 +120,14 @@ describe('BO - Shop Parameters - Product Settings : Display remaining quantities it(`should update Display remaining quantities to ${test.quantity}`, async function () { await testContext.addContextItem(this, 'testIdentifier', `setDisplayRemainingQuantity${index}`, baseContext); - const result = await productSettingsPage.setDisplayRemainingQuantities(page, test.quantity); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setDisplayRemainingQuantities(page, test.quantity); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${test.state}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); const isHomePage = await foClassicHomePage.isHomePage(page); expect(isHomePage, 'Home page was not opened').to.eq(true); @@ -160,8 +160,8 @@ describe('BO - Shop Parameters - Product Settings : Display remaining quantities page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/05_allowOrderingOutOfStock.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/05_allowOrderingOutOfStock.ts index 8c62cb8bcb10d..4cb0187ecedde 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/05_allowOrderingOutOfStock.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/05_allowOrderingOutOfStock.ts @@ -6,7 +6,6 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import pages // Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import addProductPage from '@pages/BO/catalog/products/add'; import {expect} from 'chai'; @@ -14,6 +13,7 @@ import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, foClassicHomePage, foClassicProductPage, @@ -88,8 +88,8 @@ describe('BO - Shop Parameters - Product Settings : Allow ordering of out-of-sto addProductPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -105,15 +105,15 @@ describe('BO - Shop Parameters - Product Settings : Allow ordering of out-of-sto baseContext, ); - const result = await productSettingsPage.setAllowOrderingOutOfStockStatus(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setAllowOrderingOutOfStockStatus(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${test.args.action}`, baseContext); // Go to FO - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); const isHomePage = await foClassicHomePage.isHomePage(page); expect(isHomePage, 'Home page was not opened').to.eq(true); @@ -149,18 +149,18 @@ describe('BO - Shop Parameters - Product Settings : Allow ordering of out-of-sto // Go back to BO page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToProductsPageToDeleteProduct', baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/06_labelOfInStockProducts.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/06_labelOfInStockProducts.ts index 89cca65c10c70..c260a7ab230a5 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/06_labelOfInStockProducts.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/06_labelOfInStockProducts.ts @@ -4,14 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, dataProducts, foClassicHomePage, foClassicProductPage, @@ -48,8 +45,8 @@ describe('BO - Shop Parameters - Product Settings : Update label of in-stock pro ); await boDashboardPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ {args: {label: 'Product is available', labelToCheck: 'Product is available', exist: true}}, @@ -60,14 +57,14 @@ describe('BO - Shop Parameters - Product Settings : Update label of in-stock pro it(`should set '${test.args.label}' in Label of in-stock products input`, async function () { await testContext.addContextItem(this, 'testIdentifier', `updateLabelOfInStockProducts_${index}`, baseContext); - const result = await productSettingsPage.setLabelOfInStockProducts(page, test.args.label); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setLabelOfInStockProducts(page, test.args.label); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMySHop_${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); const isHomePage = await foClassicHomePage.isHomePage(page); expect(isHomePage, 'Home page was not opened').to.eq(true); @@ -97,8 +94,8 @@ describe('BO - Shop Parameters - Product Settings : Update label of in-stock pro page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/07_labelOutOfStock.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/07_labelOutOfStock.ts index f2a803b5d3ca8..65208d1565efe 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/07_labelOutOfStock.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/07_labelOutOfStock.ts @@ -6,7 +6,6 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import pages // Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import addProductPage from '@pages/BO/catalog/products/add'; import {expect} from 'chai'; @@ -14,6 +13,7 @@ import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, foClassicHomePage, foClassicProductPage, @@ -94,8 +94,8 @@ describe('BO - Shop Parameters - product Settings : Set label out-of-stock with addProductPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -138,8 +138,8 @@ describe('BO - Shop Parameters - product Settings : Set label out-of-stock with baseContext, ); - const result = await productSettingsPage.setAllowOrderingOutOfStockStatus(page, test.args.enable); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setAllowOrderingOutOfStockStatus(page, test.args.enable); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it(`should set Label of out-of-stock products with ${test.args.backordersAction} backorders`, async function () { @@ -153,12 +153,12 @@ describe('BO - Shop Parameters - product Settings : Set label out-of-stock with let result; if (test.args.enable) { - result = await productSettingsPage.setLabelOosAllowedBackorders(page, test.args.label); + result = await boProductSettingsPage.setLabelOosAllowedBackorders(page, test.args.label); } else { - result = await productSettingsPage.setLabelOosDeniedBackorders(page, test.args.label); + result = await boProductSettingsPage.setLabelOosDeniedBackorders(page, test.args.label); } - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { @@ -169,7 +169,7 @@ describe('BO - Shop Parameters - product Settings : Set label out-of-stock with baseContext, ); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); const isHomePage = await foClassicHomePage.isHomePage(page); expect(isHomePage, 'Home page was not opened').to.eq(true); @@ -212,18 +212,18 @@ describe('BO - Shop Parameters - product Settings : Set label out-of-stock with page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToProductsPageToDeleteProduct', baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/08_enableDeliveryTimeOfInStockProducts.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/08_enableDeliveryTimeOfInStockProducts.ts index 77b3d0056d60f..e3b43c976b282 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/08_enableDeliveryTimeOfInStockProducts.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/08_enableDeliveryTimeOfInStockProducts.ts @@ -4,14 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, foClassicHomePage, foClassicProductPage, utilsPlaywright, @@ -46,8 +43,8 @@ describe('BO - Shop Parameters - Product Settings : Enable delivery time in stoc boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -59,14 +56,14 @@ describe('BO - Shop Parameters - Product Settings : Enable delivery time in stoc it(`should ${test.args.action} delivery time of in-stock products`, async function () { await testContext.addContextItem(this, 'testIdentifier', `${test.args.action}StockManagement`, baseContext); - const result = await productSettingsPage.setDeliveryTimeInStock(page, test.args.deliveryTimeText); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setDeliveryTimeInStock(page, test.args.deliveryTimeText); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const isHomePage = await foClassicHomePage.isHomePage(page); @@ -96,8 +93,8 @@ describe('BO - Shop Parameters - Product Settings : Enable delivery time in stoc page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/09_enableDeliveryTimeOfOutOfStockProducts.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/09_enableDeliveryTimeOfOutOfStockProducts.ts index 67881b528be1a..2b0a388621c3d 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/09_enableDeliveryTimeOfOutOfStockProducts.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/03_productsStock/09_enableDeliveryTimeOfOutOfStockProducts.ts @@ -6,7 +6,6 @@ import loginCommon from '@commonTests/BO/loginBO'; // Import pages // Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import addProductPage from '@pages/BO/catalog/products/add'; import {expect} from 'chai'; @@ -14,6 +13,7 @@ import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, FakerProduct, foClassicHomePage, foClassicProductPage, @@ -91,8 +91,8 @@ describe('BO - Shop Parameters - Product Settings : Enable delivery time out-of- addProductPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -104,19 +104,19 @@ describe('BO - Shop Parameters - Product Settings : Enable delivery time out-of- it(`should ${test.args.action} delivery time of out-of-stock products in BO`, async function () { await testContext.addContextItem(this, 'testIdentifier', `${test.args.action}StockManagement`, baseContext); - await productSettingsPage.setAllowOrderingOutOfStockStatus(page, test.args.enable); + await boProductSettingsPage.setAllowOrderingOutOfStockStatus(page, test.args.enable); - const result = await productSettingsPage.setDeliveryTimeOutOfStock( + const result = await boProductSettingsPage.setDeliveryTimeOutOfStock( page, test.args.deliveryTimeText, ); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); @@ -148,8 +148,8 @@ describe('BO - Shop Parameters - Product Settings : Enable delivery time out-of- page = await foClassicProductPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); @@ -159,10 +159,10 @@ describe('BO - Shop Parameters - Product Settings : Enable delivery time out-of- it('should go to \'Catalog > Products\' page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToProductsPageToDeleteProduct', baseContext); - await productSettingsPage.goToSubMenu( + await boProductSettingsPage.goToSubMenu( page, - productSettingsPage.catalogParentLink, - productSettingsPage.productsLink, + boProductSettingsPage.catalogParentLink, + boProductSettingsPage.productsLink, ); const pageTitle = await boProductsPage.getPageTitle(page); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/04_pagination/01_updateNumberOfProductsPerPage.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/04_pagination/01_updateNumberOfProductsPerPage.ts index 9ac714894f439..a6bd3bdf9fabb 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/04_pagination/01_updateNumberOfProductsPerPage.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/04_pagination/01_updateNumberOfProductsPerPage.ts @@ -4,14 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, foClassicCategoryPage, foClassicHomePage, utilsPlaywright, @@ -62,10 +59,10 @@ describe('BO - Shop Parameters - Product Settings : Update number of product dis boDashboardPage.shopParametersParentLink, boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); } @@ -74,18 +71,18 @@ describe('BO - Shop Parameters - Product Settings : Update number of product dis async function () { await testContext.addContextItem(this, 'testIdentifier', `updateProductsPerPage${index + 1}`, baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage( + const result = await boProductSettingsPage.setProductsDisplayedPerPage( page, test.args.numberOfProductsPerPage, ); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }, ); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index + 1}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); const isHomePage = await foClassicHomePage.isHomePage(page); expect(isHomePage, 'Home page was not opened').to.eq(true); @@ -117,8 +114,8 @@ describe('BO - Shop Parameters - Product Settings : Update number of product dis page = await foClassicHomePage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/04_pagination/02_updateDefaultProductsOrder.ts b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/04_pagination/02_updateDefaultProductsOrder.ts index 77cb9211dd494..8fad3519ff120 100644 --- a/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/04_pagination/02_updateDefaultProductsOrder.ts +++ b/tests/UI/campaigns/functional/BO/13_shopParameters/03_productSettings/04_pagination/02_updateDefaultProductsOrder.ts @@ -4,14 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, foClassicCategoryPage, foClassicHomePage, utilsPlaywright, @@ -51,10 +48,10 @@ describe('BO - Shop Parameters - Product Settings : Update default product order boDashboardPage.productSettingsLink, ); - await productSettingsPage.closeSfToolBar(page); + await boProductSettingsPage.closeSfToolBar(page); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); const tests = [ @@ -105,19 +102,19 @@ describe('BO - Shop Parameters - Product Settings : Update default product order it(`should set products default order to: '${test.args.orderBy} - ${test.args.orderMethod}'`, async function () { await testContext.addContextItem(this, 'testIdentifier', `updateProductsOrder${index + 1}`, baseContext); - const result = await productSettingsPage.setDefaultProductsOrder( + const result = await boProductSettingsPage.setDefaultProductsOrder( page, test.args.orderBy, test.args.orderMethod, ); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); it('should view my shop', async function () { await testContext.addContextItem(this, 'testIdentifier', `viewMyShop${index + 1}`, baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); const isHomePage = await foClassicHomePage.isHomePage(page); expect(isHomePage, 'Home page was not opened').to.eq(true); @@ -148,8 +145,8 @@ describe('BO - Shop Parameters - Product Settings : Update default product order page = await foClassicHomePage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); }); }); diff --git a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/01_sortProducts.ts b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/01_sortProducts.ts index 7fe99e80978b3..0768dba1a9f93 100644 --- a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/01_sortProducts.ts +++ b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/01_sortProducts.ts @@ -4,14 +4,12 @@ import testContext from '@utils/testContext'; // Import common tests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, foClassicCategoryPage, foClassicHomePage, utilsCore, @@ -88,15 +86,15 @@ describe('FO - Menu and navigation : Sort products', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the value of products per page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeProductPerPage', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, numberOfActiveProducts); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, numberOfActiveProducts); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -106,7 +104,7 @@ describe('FO - Menu and navigation : Sort products', async () => { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO', baseContext); // Click on view my shop - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const result = await foClassicHomePage.isHomePage(page); @@ -195,15 +193,15 @@ describe('FO - Menu and navigation : Sort products', async () => { page = await foClassicCategoryPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the value of products per page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'ResetProductPerPage', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 12); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 12); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); }); diff --git a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/02_filterProducts.ts b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/02_filterProducts.ts index 91cc0bb39dbed..6a0958032c0a8 100644 --- a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/02_filterProducts.ts +++ b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/02_filterProducts.ts @@ -4,14 +4,12 @@ import testContext from '@utils/testContext'; // Import common tests import loginCommon from '@commonTests/BO/loginBO'; -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, foClassicHomePage, foClassicCategoryPage, utilsPlaywright, @@ -86,15 +84,15 @@ describe('FO - Menu and navigation : Filter products', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the value of products per page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeProductPerPage', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, numberOfActiveProducts); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, numberOfActiveProducts); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -104,7 +102,7 @@ describe('FO - Menu and navigation : Filter products', async () => { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO', baseContext); // Click on view my shop - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const result = await foClassicHomePage.isHomePage(page); @@ -473,15 +471,15 @@ describe('FO - Menu and navigation : Filter products', async () => { page = await foClassicCategoryPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the value of products per page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'ResetProductPerPage', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 12); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 12); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); }); diff --git a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/03_clearOneFilter.ts b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/03_clearOneFilter.ts index dfc84f843139c..1a554215bbcc3 100644 --- a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/03_clearOneFilter.ts +++ b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/02_sortAndFilter/03_clearOneFilter.ts @@ -4,14 +4,12 @@ import testContext from '@utils/testContext'; // Import common tests import loginCommon from '@commonTests/BO/loginBO'; -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, foClassicHomePage, foClassicCategoryPage, utilsPlaywright, @@ -79,7 +77,7 @@ describe('FO - Menu and navigation : Clear one filter', async () => { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO', baseContext); // Click on view my shop - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const result = await foClassicHomePage.isHomePage(page); diff --git a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/03_navigationAndDisplay/01_displayTags.ts b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/03_navigationAndDisplay/01_displayTags.ts index f9c56b37dc3c2..ecdf7356810b2 100644 --- a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/03_navigationAndDisplay/01_displayTags.ts +++ b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/03_navigationAndDisplay/01_displayTags.ts @@ -8,7 +8,6 @@ import {deleteProductTest} from '@commonTests/BO/catalog/product'; // Import pages import addProductPage from '@pages/BO/catalog/products/add'; import pricingTab from '@pages/BO/catalog/products/add/pricingTab'; -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; @@ -16,6 +15,7 @@ import { boDashboardPage, boProductsPage, boProductsCreateTabStocksPage, + boProductSettingsPage, dataProducts, FakerProduct, foClassicHomePage, @@ -146,15 +146,15 @@ describe('FO - Navigation and display : Display tags', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of days to 0', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays0', baseContext); - const result = await productSettingsPage.updateNumberOfDays(page, 0); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.updateNumberOfDays(page, 0); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -396,15 +396,15 @@ describe('FO - Navigation and display : Display tags', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of days to 12', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays', baseContext); - const result = await productSettingsPage.updateNumberOfDays(page, 12); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.updateNumberOfDays(page, 12); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); diff --git a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/03_navigationAndDisplay/02_pagination.ts b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/03_navigationAndDisplay/02_pagination.ts index c3a4e7b5dc9e8..b5fe332b332e7 100644 --- a/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/03_navigationAndDisplay/02_pagination.ts +++ b/tests/UI/campaigns/functional/FO/classic/08_menuAndNavigation/03_navigationAndDisplay/02_pagination.ts @@ -4,13 +4,11 @@ import testContext from '@utils/testContext'; // Import commonTests import loginCommon from '@commonTests/BO/loginBO'; -// Import pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, foClassicCategoryPage, foClassicHomePage, utilsPlaywright, @@ -118,15 +116,15 @@ describe('FO - Navigation and display : Pagination', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of products per page to 6', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays0', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 6); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 6); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -134,7 +132,7 @@ describe('FO - Navigation and display : Pagination', async () => { it('should view my shop page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO1', baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const result = await foClassicHomePage.isHomePage(page); @@ -197,15 +195,15 @@ describe('FO - Navigation and display : Pagination', async () => { page = await foClassicHomePage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of products per page to 20', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays1', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 20); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 20); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -213,7 +211,7 @@ describe('FO - Navigation and display : Pagination', async () => { it('should view my shop page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO2', baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foClassicHomePage.changeLanguage(page, 'en'); const result = await foClassicHomePage.isHomePage(page); @@ -252,15 +250,15 @@ describe('FO - Navigation and display : Pagination', async () => { page = await foClassicHomePage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of products per page to 12', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays2', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 12); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 12); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); }); diff --git a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/01_sortProducts.ts b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/01_sortProducts.ts index 28330c5095945..e934a88196c92 100644 --- a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/01_sortProducts.ts +++ b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/01_sortProducts.ts @@ -5,14 +5,12 @@ import testContext from '@utils/testContext'; import loginCommon from '@commonTests/BO/loginBO'; import {enableHummingbird, disableHummingbird} from '@commonTests/BO/design/hummingbird'; -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, foHummingbirdCategoryPage, foHummingbirdHomePage, utilsCore, @@ -94,15 +92,15 @@ describe('FO - Menu and navigation : Sort products', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the value of products per page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeProductPerPage', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, numberOfActiveProducts); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, numberOfActiveProducts); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -112,7 +110,7 @@ describe('FO - Menu and navigation : Sort products', async () => { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO', baseContext); // Click on view my shop - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foHummingbirdHomePage.changeLanguage(page, 'en'); const result = await foHummingbirdHomePage.isHomePage(page); @@ -201,15 +199,15 @@ describe('FO - Menu and navigation : Sort products', async () => { page = await foHummingbirdCategoryPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the value of products per page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'ResetProductPerPage', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 12); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 12); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); diff --git a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/02_filterProducts.ts b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/02_filterProducts.ts index d4c64f9c9057e..ab08fb8c5464a 100644 --- a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/02_filterProducts.ts +++ b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/02_filterProducts.ts @@ -5,14 +5,12 @@ import testContext from '@utils/testContext'; import loginCommon from '@commonTests/BO/loginBO'; import {enableHummingbird, disableHummingbird} from '@commonTests/BO/design/hummingbird'; -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, foHummingbirdCategoryPage, foHummingbirdHomePage, utilsPlaywright, @@ -92,15 +90,15 @@ describe('FO - Menu and navigation : Filter products', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the value of products per page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeProductPerPage', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, numberOfActiveProducts); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, numberOfActiveProducts); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -110,7 +108,7 @@ describe('FO - Menu and navigation : Filter products', async () => { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO', baseContext); // Click on view my shop - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foHummingbirdHomePage.changeLanguage(page, 'en'); const result = await foHummingbirdHomePage.isHomePage(page); @@ -484,15 +482,15 @@ describe('FO - Menu and navigation : Filter products', async () => { page = await foHummingbirdCategoryPage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the value of products per page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'ResetProductPerPage', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 12); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 12); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); diff --git a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/03_clearFilters.ts b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/03_clearFilters.ts index f848dd66fb086..e43af3fbe1a8a 100644 --- a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/03_clearFilters.ts +++ b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/02_sortAndFilter/03_clearFilters.ts @@ -5,14 +5,12 @@ import testContext from '@utils/testContext'; import loginCommon from '@commonTests/BO/loginBO'; import {enableHummingbird, disableHummingbird} from '@commonTests/BO/design/hummingbird'; -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, boProductsPage, + boProductSettingsPage, foHummingbirdCategoryPage, foHummingbirdHomePage, utilsPlaywright, @@ -83,7 +81,7 @@ describe('FO - Menu and navigation : Clear filters', async () => { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO', baseContext); // Click on view my shop - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foHummingbirdHomePage.changeLanguage(page, 'en'); const result = await foHummingbirdHomePage.isHomePage(page); diff --git a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/03_navigationAndDisplay/01_displayTags.ts b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/03_navigationAndDisplay/01_displayTags.ts index 3f9341d1c493a..fcd7561ce5851 100644 --- a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/03_navigationAndDisplay/01_displayTags.ts +++ b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/03_navigationAndDisplay/01_displayTags.ts @@ -9,7 +9,6 @@ import {enableHummingbird, disableHummingbird} from '@commonTests/BO/design/humm // Import BO pages import addProductPage from '@pages/BO/catalog/products/add'; import pricingTab from '@pages/BO/catalog/products/add/pricingTab'; -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; @@ -17,6 +16,7 @@ import { boDashboardPage, boProductsPage, boProductsCreateTabStocksPage, + boProductSettingsPage, dataProducts, FakerProduct, foHummingbirdHomePage, @@ -159,15 +159,15 @@ describe('FO - Navigation and display : Display tags', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of days to 0', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays0', baseContext); - const result = await productSettingsPage.updateNumberOfDays(page, 0); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.updateNumberOfDays(page, 0); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -409,15 +409,15 @@ describe('FO - Navigation and display : Display tags', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of days to 12', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays', baseContext); - const result = await productSettingsPage.updateNumberOfDays(page, 12); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.updateNumberOfDays(page, 12); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); diff --git a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/03_navigationAndDisplay/02_pagination.ts b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/03_navigationAndDisplay/02_pagination.ts index 2db0d7e48a0da..932969bf1e52d 100644 --- a/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/03_navigationAndDisplay/02_pagination.ts +++ b/tests/UI/campaigns/functional/FO/hummingbird/08_menuAndNavigation/03_navigationAndDisplay/02_pagination.ts @@ -5,13 +5,11 @@ import testContext from '@utils/testContext'; import loginCommon from '@commonTests/BO/loginBO'; import {enableHummingbird, disableHummingbird} from '@commonTests/BO/design/hummingbird'; -// Import BO pages -import productSettingsPage from '@pages/BO/shopParameters/productSettings'; - import {expect} from 'chai'; import type {BrowserContext, Page} from 'playwright'; import { boDashboardPage, + boProductSettingsPage, foHummingbirdCategoryPage, foHummingbirdHomePage, utilsPlaywright, @@ -125,15 +123,15 @@ describe('FO - Navigation and display : Pagination', async () => { boDashboardPage.productSettingsLink, ); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of products per page to 6', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays0', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 6); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 6); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -141,7 +139,7 @@ describe('FO - Navigation and display : Pagination', async () => { it('should view my shop page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO1', baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foHummingbirdHomePage.changeLanguage(page, 'en'); const result = await foHummingbirdHomePage.isHomePage(page); @@ -204,15 +202,15 @@ describe('FO - Navigation and display : Pagination', async () => { page = await foHummingbirdHomePage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of products per page to 20', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays1', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 20); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 20); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); @@ -220,7 +218,7 @@ describe('FO - Navigation and display : Pagination', async () => { it('should view my shop page', async function () { await testContext.addContextItem(this, 'testIdentifier', 'goToShopFO2', baseContext); - page = await productSettingsPage.viewMyShop(page); + page = await boProductSettingsPage.viewMyShop(page); await foHummingbirdHomePage.changeLanguage(page, 'en'); const result = await foHummingbirdHomePage.isHomePage(page); @@ -259,15 +257,15 @@ describe('FO - Navigation and display : Pagination', async () => { page = await foHummingbirdHomePage.closePage(browserContext, page, 0); - const pageTitle = await productSettingsPage.getPageTitle(page); - expect(pageTitle).to.contains(productSettingsPage.pageTitle); + const pageTitle = await boProductSettingsPage.getPageTitle(page); + expect(pageTitle).to.contains(boProductSettingsPage.pageTitle); }); it('should change the number of products per page to 12', async function () { await testContext.addContextItem(this, 'testIdentifier', 'changeNumberOfDays2', baseContext); - const result = await productSettingsPage.setProductsDisplayedPerPage(page, 12); - expect(result).to.contains(productSettingsPage.successfulUpdateMessage); + const result = await boProductSettingsPage.setProductsDisplayedPerPage(page, 12); + expect(result).to.contains(boProductSettingsPage.successfulUpdateMessage); }); }); diff --git a/tests/UI/pages/BO/shopParameters/productSettings/index.ts b/tests/UI/pages/BO/shopParameters/productSettings/index.ts deleted file mode 100644 index aa6a6821d54a3..0000000000000 --- a/tests/UI/pages/BO/shopParameters/productSettings/index.ts +++ /dev/null @@ -1,478 +0,0 @@ -import BOBasePage from '@pages/BO/BObasePage'; - -import type {Page} from 'playwright'; - -/** - * Product settings page, contains selectors and functions for the page - * @class - * @extends BOBasePage - */ -class ProductSettings extends BOBasePage { - public readonly pageTitle: string; - - private readonly catalogModeToggleInput: (toggle: number) => string; - - private readonly showPricesToggleInput: (toggle: number) => string; - - private readonly maxSizeShortDescriptionInput: string; - - private readonly newDaysNumberInput: string; - - private readonly forceUpdateFriendlyUrlToggleInput: (toggle: number) => string; - - private readonly quantityDiscountBasedOnSelect: string; - - private readonly defaultActivationStatusToggleInput: (toggle: number) => string; - - private readonly saveProductGeneralFormButton: string; - - private readonly displayAvailableQuantitiesToggleInput: (toggle: number) => string; - - private readonly displayAddToCartToggleInput: (toggle: number) => string; - - private readonly separatorAttributeOnProductPageSelect: string; - - private readonly displayDiscountedPriceToggleInput: (toggle: number) => string; - - private readonly saveProductPageFormButton: string; - - private readonly productsStockForm: string; - - private readonly allowOrderingOosToggleInput: (toggle: number) => string; - - private readonly enableStockManagementToggleInput: (toggle: number) => string; - - private readonly nameLangButton: string; - - private readonly nameLangSpan: (lang: string) => string; - - private readonly labelInStock: (idLang: number) => string; - - private readonly deliveryTimeInStockInput: string; - - private readonly deliveryTimeOutOfStockInput: string; - - private readonly oosAllowedBackordersLabel: (idLang: number) => string; - - private readonly oosDeniedBackordersLabel: (idLang: number) => string; - - private readonly remainingQuantityInput: string; - - private readonly displayUnavailableAttributesToggleInput: (toggle: number) => string; - - private readonly defaultPackStockManagementSelect: string; - - private readonly saveProductsStockFormButton: string; - - private readonly productsPerPageInput: string; - - private readonly productsDefaultOrderBySelect: string; - - private readonly productsDefaultOrderMethodSelect: string; - - private readonly savePaginationFormButton: string; - - /** - * @constructs - * Setting up titles and selectors to use on add product settings page - */ - constructor() { - super(); - - this.pageTitle = `Product settings • ${global.INSTALL.SHOP_NAME}`; - this.successfulUpdateMessage = 'Update successful'; - - // Selectors - // Products general form - this.catalogModeToggleInput = (toggle: number) => `#general_catalog_mode_${toggle}`; - this.showPricesToggleInput = (toggle: number) => `#general_catalog_mode_with_prices_${toggle}`; - this.maxSizeShortDescriptionInput = '#general_short_description_limit'; - this.newDaysNumberInput = '#general_new_days_number'; - this.forceUpdateFriendlyUrlToggleInput = (toggle: number) => `#general_force_friendly_url_${toggle}`; - this.quantityDiscountBasedOnSelect = '#general_quantity_discount'; - this.defaultActivationStatusToggleInput = (toggle: number) => `#general_default_status_${toggle}`; - this.saveProductGeneralFormButton = '#form-general-save-button'; - - // Product page form - this.displayAvailableQuantitiesToggleInput = (toggle: number) => `#page_display_quantities_${toggle}`; - this.displayAddToCartToggleInput = (toggle: number) => `#page_allow_add_variant_to_cart_from_listing_${toggle}`; - this.separatorAttributeOnProductPageSelect = '#page_attribute_anchor_separator'; - this.displayDiscountedPriceToggleInput = (toggle: number) => `#page_display_discount_price_${toggle}`; - this.saveProductPageFormButton = '#form-page-save-button'; - - // Products stock form - this.productsStockForm = '#configuration_fieldset_stock'; - this.allowOrderingOosToggleInput = (toggle: number) => `#stock_allow_ordering_oos_${toggle}`; - this.enableStockManagementToggleInput = (toggle: number) => `#stock_stock_management_${toggle}`; - this.nameLangButton = '#stock_in_stock_label_dropdown'; - this.nameLangSpan = (lang: string) => 'div.dropdown-menu[aria-labelledby=\'stock_in_stock_label_dropdown\']' - + ` span[data-locale='${lang}']`; - this.labelInStock = (idLang: number) => `#stock_in_stock_label_${idLang}`; - this.deliveryTimeInStockInput = '#stock_delivery_time_1'; - this.deliveryTimeOutOfStockInput = '#stock_oos_delivery_time_1'; - this.oosAllowedBackordersLabel = (idLang: number) => `#stock_oos_allowed_backorders_${idLang}`; - this.oosDeniedBackordersLabel = (idLang: number) => `#stock_oos_denied_backorders_${idLang}`; - this.remainingQuantityInput = '#stock_display_last_quantities'; - this.displayUnavailableAttributesToggleInput = (toggle: number) => `#stock_display_unavailable_attributes_${toggle}`; - this.defaultPackStockManagementSelect = '#stock_pack_stock_management'; - this.saveProductsStockFormButton = '#form-stock-save-button'; - - // Pagination form - this.productsPerPageInput = '#pagination_products_per_page'; - this.productsDefaultOrderBySelect = '#pagination_default_order_by'; - this.productsDefaultOrderMethodSelect = '#pagination_default_order_way'; - this.savePaginationFormButton = '#form-pagination-save-button'; - } - - /* - Methods - */ - - /** - * Enable/disable catalog mode - * @param page {Page} Browser tab - * @param toEnable {boolean} True if we need to enable catalog mode status - * @return {Promise} - */ - async changeCatalogModeStatus(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.catalogModeToggleInput(toEnable ? 1 : 0)); - await this.clickAndWaitForLoadState(page, this.saveProductGeneralFormButton); - await this.elementNotVisible(page, this.catalogModeToggleInput(!toEnable ? 1 : 0), 2000); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Enable/disable show prices - * @param page {Page} Browser tab - * @param toEnable {boolean} True if we need to enable show prices status - * @return {Promise} - */ - async setShowPricesStatus(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.showPricesToggleInput(toEnable ? 1 : 0)); - await this.clickAndWaitForLoadState(page, this.saveProductGeneralFormButton); - await this.elementNotVisible(page, this.showPricesToggleInput(!toEnable ? 1 : 0), 2000); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Update number of days - * @param page {Page} Browser tab - * @param numberOfDays {number} Value to set on number of days input - * @returns {Promise} - */ - async updateNumberOfDays(page: Page, numberOfDays: number): Promise { - await this.setValue(page, this.newDaysNumberInput, numberOfDays); - await page.locator(this.saveProductGeneralFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Update max size of short description - * @param page {Page} Browser tab - * @param size {number} Value to set on size input - * @returns {Promise} - */ - async UpdateMaxSizeOfSummary(page: Page, size: number): Promise { - await this.setValue(page, this.maxSizeShortDescriptionInput, size); - await page.locator(this.saveProductGeneralFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Enable/Disable force update of friendly URL - * @param page {Page} Browser tab - * @param toEnable {boolean} True if we need to enable force update friendly url status - * @returns {Promise} - */ - async setForceUpdateFriendlyURLStatus(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.forceUpdateFriendlyUrlToggleInput(toEnable ? 1 : 0)); - await page.locator(this.saveProductGeneralFormButton).click(); - await this.elementNotVisible(page, this.forceUpdateFriendlyUrlToggleInput(!toEnable ? 1 : 0), 2000); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Change default activation status - * @param page {Page} Browser tab - * @param toEnable {boolean} True if we need to enable default activation status - * @returns {Promise} - */ - async setDefaultActivationStatus(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.defaultActivationStatusToggleInput(toEnable ? 1 : 0)); - await page.locator(this.saveProductGeneralFormButton).click(); - await this.elementNotVisible(page, this.defaultActivationStatusToggleInput(!toEnable ? 1 : 0), 2000); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Choose quantity discounts based on - * @param page {Page} Browser tab - * @param basedOn {string} Value of quantity discount based on - * @returns {Promise} - */ - async chooseQuantityDiscountsBasedOn(page: Page, basedOn: string): Promise { - await this.selectByVisibleText(page, this.quantityDiscountBasedOnSelect, basedOn); - await page.locator(this.saveProductGeneralFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Enable/ Disable display available quantities - * @param page {Page} Browser tab - * @param toEnable {boolean} Status to set to display available quantity - * @returns {Promise} - */ - async setDisplayAvailableQuantitiesStatus(page: Page, toEnable: boolean = true): Promise { - await this.closeAlertBlock(page); - await this.setChecked(page, this.displayAvailableQuantitiesToggleInput(toEnable ? 1 : 0)); - await page.locator(this.saveProductPageFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Enable/disable display add to cart button - * @param page {Page} Browser tab - * @param toEnable {boolean} Status to set to display add to cart button - * @returns {Promise} - */ - async setDisplayAddToCartButton(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.displayAddToCartToggleInput(toEnable ? 1 : 0)); - await page.locator(this.saveProductPageFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set display remaining quantities - * @param page {Page} Browser tab - * @param quantity {number} Value of remaining quantity to set - * @returns {Promise} - */ - async setDisplayRemainingQuantities(page: Page, quantity: number): Promise { - await this.closeAlertBlock(page); - await this.setValue(page, this.remainingQuantityInput, quantity); - await page.locator(this.saveProductsStockFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set display unavailable product attributes - * @param page {Page} Browser tab - * @param toEnable {boolean} True if we need to enable unavailable attributes - * @returns {Promise} - */ - async setDisplayUnavailableProductAttributesStatus(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.displayUnavailableAttributesToggleInput(toEnable ? 1 : 0)); - await page.locator(this.saveProductsStockFormButton).click(); - await this.elementNotVisible(page, this.displayUnavailableAttributesToggleInput(!toEnable ? 1 : 0), 2000); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set separator of attribute anchor on the product links - * @param page {Page} Browser tab - * @param separator {string} Value of separator attribute on product page - * @returns {Promise} - */ - async setSeparatorOfAttributeOnProductLink(page: Page, separator: string): Promise { - await this.selectByVisibleText(page, this.separatorAttributeOnProductPageSelect, separator); - await page.locator(this.saveProductPageFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Enable/Disable allow ordering out of stock - * @param page {Page} Browser tab - * @param toEnable {boolean} True if we need to enable allow ordering out of stock status - * @returns {Promise} - */ - async setAllowOrderingOutOfStockStatus(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.allowOrderingOosToggleInput(toEnable ? 1 : 0)); - await page.locator(this.saveProductsStockFormButton).click(); - await this.elementNotVisible(page, this.allowOrderingOosToggleInput(!toEnable ? 1 : 0), 2000); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Enable/Disable stock management - * @param page {Page} Browser tab - * @param toEnable {boolean} True if we need to enable stock management status - * @returns {Promise} - */ - async setEnableStockManagementStatus(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.enableStockManagementToggleInput(toEnable ? 1 : 0)); - if (toEnable) { - await this.setChecked(page, this.allowOrderingOosToggleInput(0)); - } - await page.locator(this.saveProductsStockFormButton).click(); - await this.elementNotVisible(page, this.enableStockManagementToggleInput(!toEnable ? 1 : 0), 2000); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set number of products displayed per page - * @param page {Page} Browser tab - * @param numberOfProducts {number} Value to set on products per page input - * @return {Promise} - */ - async setProductsDisplayedPerPage(page: Page, numberOfProducts: number): Promise { - await this.setValue(page, this.productsPerPageInput, numberOfProducts); - await page.locator(this.savePaginationFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Change language for selectors - * @param page {Page} Browser tab - * @param lang {string} Language to choose - * @return {Promise} - */ - async changeLanguageForSelectors(page: Page, lang: string = 'en'): Promise { - await Promise.all([ - page.locator(this.nameLangButton).click(), - this.waitForVisibleSelector(page, `${this.nameLangButton}[aria-expanded='true']`), - ]); - await Promise.all([ - page.locator(this.nameLangSpan(lang)).click(), - this.waitForVisibleSelector(page, `${this.nameLangButton}[aria-expanded='false']`), - ]); - } - - /** - * Set label of in_stock products - * @param page {Page} Browser tab - * @param label {string} Value to set on label of in stock product input - * @returns {Promise} - */ - async setLabelOfInStockProducts(page: Page, label: string): Promise { - // Fill label in english - await this.changeLanguageForSelectors(page, 'en'); - await this.setValue(page, this.labelInStock(1), label); - // Fill label in french - await this.changeLanguageForSelectors(page, 'fr'); - await this.setValue(page, this.labelInStock(2), label); - await page.locator(this.saveProductsStockFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set delivery time text - * @param page {Page} Browser tab - * @param deliveryTimeText {string} Value to set on delivery time in stock input - * @return {Promise} - */ - async setDeliveryTimeInStock(page: Page, deliveryTimeText: string): Promise { - await this.setValue(page, this.deliveryTimeInStockInput, deliveryTimeText); - await page.locator(this.saveProductsStockFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set display discounted price - * @param page {Page} Browser tab - * @param toEnable {boolean} True if we need to enable display discounted price status - * @returns {Promise} - */ - async setDisplayDiscountedPriceStatus(page: Page, toEnable: boolean = true): Promise { - await this.setChecked(page, this.displayDiscountedPriceToggleInput(toEnable ? 1 : 0)); - await page.locator(this.saveProductPageFormButton).click(); - await this.elementNotVisible(page, this.displayDiscountedPriceToggleInput(!toEnable ? 1 : 0), 2000); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set default order for products on products list in FO - * @param page {Page} Browser tab - * @param orderBy {string} The order in which products will be displayed in the product list - * @param orderMethod {string} Order method for product list - * @return {Promise} - */ - async setDefaultProductsOrder(page: Page, orderBy: string, orderMethod: string = 'Ascending'): Promise { - await this.selectByVisibleText(page, this.productsDefaultOrderBySelect, orderBy); - await this.selectByVisibleText(page, this.productsDefaultOrderMethodSelect, orderMethod); - await page.locator(this.savePaginationFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set delivery time out-of-stock text - * @param page {Page} Browser tab - * @param deliveryTimeText {string} Vale to set on delivery time out of stock input - * @return {Promise} - */ - async setDeliveryTimeOutOfStock(page: Page, deliveryTimeText: string = ''): Promise { - await this.setValue(page, this.deliveryTimeOutOfStockInput, deliveryTimeText); - await page.locator(this.saveProductsStockFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set label out-of-stock allowed backorders - * @param page {Page} Browser tab - * @param label {string} Value to set on label out of stock allowed backorders - * @returns {Promise} - */ - async setLabelOosAllowedBackorders(page: Page, label: string): Promise { - // Fill label in english - await this.changeLanguageForSelectors(page, 'en'); - await this.setValue(page, this.oosAllowedBackordersLabel(1), label); - // Fill label in french - await this.changeLanguageForSelectors(page, 'fr'); - await this.setValue(page, this.oosAllowedBackordersLabel(2), label); - await page.locator(this.saveProductsStockFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set label out-of-stock denied backorders - * @param page {Page} Browser tab - * @param label {string} Value to set on label out of stock denied backorders input - * @returns {Promise} - */ - async setLabelOosDeniedBackorders(page: Page, label: string): Promise { - // Fill label in english - await this.changeLanguageForSelectors(page, 'en'); - await this.setValue(page, this.oosDeniedBackordersLabel(1), label); - // Fill label in french - await this.changeLanguageForSelectors(page, 'fr'); - await this.setValue(page, this.oosDeniedBackordersLabel(2), label); - await page.locator(this.saveProductsStockFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } - - /** - * Set default pack stock management - * @param page {Page} Browser tab - * @param option {string} Option to select on default pack stock management - * @returns {Promise} - */ - async setDefaultPackStockManagement(page: Page, option: string): Promise { - await this.selectByVisibleText(page, this.defaultPackStockManagementSelect, option); - await page.locator(this.saveProductsStockFormButton).click(); - - return this.getAlertSuccessBlockParagraphContent(page); - } -} - -export default new ProductSettings(); From 1ce633bcebe2cb0965ede2ca39a5af0c9b51832b Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 20 Sep 2024 17:41:52 +0200 Subject: [PATCH 3/3] Bump `@prestashop-core/ui-testing` --- tests/UI/package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/UI/package-lock.json b/tests/UI/package-lock.json index 546a85088e59a..c8d5feda0d567 100644 --- a/tests/UI/package-lock.json +++ b/tests/UI/package-lock.json @@ -431,7 +431,7 @@ }, "node_modules/@prestashop-core/ui-testing": { "version": "0.0.12", - "resolved": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#a75b2bc0989cdbba2938b457c1e52d14ae2a6031", + "resolved": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#17c37468429b6a22ac64e81b62e44c6001004689", "license": "MIT", "dependencies": { "@faker-js/faker": "^8.3.1", @@ -8430,7 +8430,7 @@ } }, "@prestashop-core/ui-testing": { - "version": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#a75b2bc0989cdbba2938b457c1e52d14ae2a6031", + "version": "git+ssh://git@github.com/PrestaShop/ui-testing-library.git#17c37468429b6a22ac64e81b62e44c6001004689", "from": "@prestashop-core/ui-testing@https://github.com/PrestaShop/ui-testing-library#main", "requires": { "@faker-js/faker": "^8.3.1",