From a3f33a40fd43b6c5df024c95c04302420aa285df Mon Sep 17 00:00:00 2001 From: Stefano Motta <117469730+smottal@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:01:30 +0100 Subject: [PATCH] LPD-17814 Rename --- .../playwright/fixtures/commercePagesTest.ts | 30 +++++++++---------- ....ts => commerceAdminProductDetailsPage.ts} | 2 +- ...dminProductDetailsProductRelationsPage.ts} | 2 +- ...minPage.ts => commerceAdminProductPage.ts} | 2 +- .../commerceAdminProductRelations.spec.ts | 22 +++++++------- .../tests/commerce/commerceMiniCart.spec.ts | 8 ++--- 6 files changed, 33 insertions(+), 33 deletions(-) rename modules/test/playwright/pages/commerce/{commerceProductAdminDetailsPage.ts => commerceAdminProductDetailsPage.ts} (91%) rename modules/test/playwright/pages/commerce/{commerceProductAdminDetailsProductRelationsPage.ts => commerceAdminProductDetailsProductRelationsPage.ts} (92%) rename modules/test/playwright/pages/commerce/{commerceProductAdminPage.ts => commerceAdminProductPage.ts} (97%) diff --git a/modules/test/playwright/fixtures/commercePagesTest.ts b/modules/test/playwright/fixtures/commercePagesTest.ts index 77c667df77f586..8db5ebdeafbe56 100644 --- a/modules/test/playwright/fixtures/commercePagesTest.ts +++ b/modules/test/playwright/fixtures/commercePagesTest.ts @@ -15,11 +15,11 @@ import {CommerceAdminChannelDetailsPage} from '../pages/commerce/commerceAdminCh import {CommerceAdminChannelsPage} from '../pages/commerce/commerceAdminChannelsPage'; import {CommerceAdminOrderDetailsPage} from '../pages/commerce/commerceAdminOrderDetailsPage'; import {CommerceAdminOrdersPage} from '../pages/commerce/commerceAdminOrdersPage'; +import {CommerceAdminProductDetailsPage} from '../pages/commerce/commerceAdminProductDetailsPage'; +import {CommerceAdminProductDetailsProductRelationsPage} from '../pages/commerce/commerceAdminProductDetailsProductRelationsPage'; +import {CommerceAdminProductPage} from '../pages/commerce/commerceAdminProductPage'; import {CommerceLayoutsPage} from '../pages/commerce/commerceLayoutsPage'; import {CommerceMiniCartPage} from '../pages/commerce/commerceMiniCartPage'; -import {CommerceProductAdminDetailsPage} from '../pages/commerce/commerceProductAdminDetailsPage'; -import {CommerceProductAdminDetailsProductRelationsPage} from '../pages/commerce/commerceProductAdminDetailsProductRelationsPage'; -import {CommerceProductAdminPage} from '../pages/commerce/commerceProductAdminPage'; const commercePagesTest = test.extend<{ attachmentsPage: AttachmentsPage; @@ -28,11 +28,11 @@ const commercePagesTest = test.extend<{ commerceAdminChannelsPage: CommerceAdminChannelsPage; commerceAdminOrderDetailsPage: CommerceAdminOrderDetailsPage; commerceAdminOrdersPage: CommerceAdminOrdersPage; + commerceAdminProductDetailsPage: CommerceAdminProductDetailsPage; + commerceAdminProductDetailsProductRelationsPage: CommerceAdminProductDetailsProductRelationsPage; + commerceAdminProductPage: CommerceAdminProductPage; commerceLayoutsPage: CommerceLayoutsPage; commerceMiniCartPage: CommerceMiniCartPage; - commerceProductAdminDetailsPage: CommerceProductAdminDetailsPage; - commerceProductAdminDetailsProductRelationsPage: CommerceProductAdminDetailsProductRelationsPage; - commerceProductAdminPage: CommerceProductAdminPage; pendingOrdersPage: PendingOrdersPage; specificationFacetsPage: SpecificationFacetsPage; }>({ @@ -54,21 +54,21 @@ const commercePagesTest = test.extend<{ commerceAdminOrdersPage: async ({page}, use) => { await use(new CommerceAdminOrdersPage(page)); }, + commerceAdminProductDetailsPage: async ({page}, use) => { + await use(new CommerceAdminProductDetailsPage(page)); + }, + commerceAdminProductDetailsProductRelationsPage: async ({page}, use) => { + await use(new CommerceAdminProductDetailsProductRelationsPage(page)); + }, + commerceAdminProductPage: async ({page}, use) => { + await use(new CommerceAdminProductPage(page)); + }, commerceLayoutsPage: async ({page}, use) => { await use(new CommerceLayoutsPage(page)); }, commerceMiniCartPage: async ({page}, use) => { await use(new CommerceMiniCartPage(page)); }, - commerceProductAdminDetailsPage: async ({page}, use) => { - await use(new CommerceProductAdminDetailsPage(page)); - }, - commerceProductAdminDetailsProductRelationsPage: async ({page}, use) => { - await use(new CommerceProductAdminDetailsProductRelationsPage(page)); - }, - commerceProductAdminPage: async ({page}, use) => { - await use(new CommerceProductAdminPage(page)); - }, pendingOrdersPage: async ({page}, use) => { await use(new PendingOrdersPage(page)); }, diff --git a/modules/test/playwright/pages/commerce/commerceProductAdminDetailsPage.ts b/modules/test/playwright/pages/commerce/commerceAdminProductDetailsPage.ts similarity index 91% rename from modules/test/playwright/pages/commerce/commerceProductAdminDetailsPage.ts rename to modules/test/playwright/pages/commerce/commerceAdminProductDetailsPage.ts index 0ca8d936dc0ff7..ced7acef8b0493 100644 --- a/modules/test/playwright/pages/commerce/commerceProductAdminDetailsPage.ts +++ b/modules/test/playwright/pages/commerce/commerceAdminProductDetailsPage.ts @@ -5,7 +5,7 @@ import {Locator, Page} from '@playwright/test'; -export class CommerceProductAdminDetailsPage { +export class CommerceAdminProductDetailsPage { readonly productRelationsTab: Locator; readonly page: Page; diff --git a/modules/test/playwright/pages/commerce/commerceProductAdminDetailsProductRelationsPage.ts b/modules/test/playwright/pages/commerce/commerceAdminProductDetailsProductRelationsPage.ts similarity index 92% rename from modules/test/playwright/pages/commerce/commerceProductAdminDetailsProductRelationsPage.ts rename to modules/test/playwright/pages/commerce/commerceAdminProductDetailsProductRelationsPage.ts index dcd320bcac1117..d313eb396a962a 100644 --- a/modules/test/playwright/pages/commerce/commerceProductAdminDetailsProductRelationsPage.ts +++ b/modules/test/playwright/pages/commerce/commerceAdminProductDetailsProductRelationsPage.ts @@ -7,7 +7,7 @@ import {Locator, Page} from '@playwright/test'; import {CommerceDNDTablePage} from './commerceDNDTablePage'; -export class CommerceProductAdminDetailsProductRelationsPage extends CommerceDNDTablePage { +export class CommerceAdminProductDetailsProductRelationsPage extends CommerceDNDTablePage { readonly deleteBulkButton: Locator; readonly page: Page; readonly selectItemsInput: Locator; diff --git a/modules/test/playwright/pages/commerce/commerceProductAdminPage.ts b/modules/test/playwright/pages/commerce/commerceAdminProductPage.ts similarity index 97% rename from modules/test/playwright/pages/commerce/commerceProductAdminPage.ts rename to modules/test/playwright/pages/commerce/commerceAdminProductPage.ts index 878c8e5d8410df..ae005733cda830 100644 --- a/modules/test/playwright/pages/commerce/commerceProductAdminPage.ts +++ b/modules/test/playwright/pages/commerce/commerceAdminProductPage.ts @@ -7,7 +7,7 @@ import {Locator, Page} from '@playwright/test'; import {ApplicationsMenuPage} from '../product-navigation-applications-menu/ApplicationsMenuPage'; -export class CommerceProductAdminPage { +export class CommerceAdminProductPage { readonly applicationsMenuPage: ApplicationsMenuPage; readonly creationMenuNewButton: Locator; readonly generateSkusMenuItem: Locator; diff --git a/modules/test/playwright/tests/commerce/commerceAdminProductRelations.spec.ts b/modules/test/playwright/tests/commerce/commerceAdminProductRelations.spec.ts index d0dccf645c3c2d..2cc802da686316 100644 --- a/modules/test/playwright/tests/commerce/commerceAdminProductRelations.spec.ts +++ b/modules/test/playwright/tests/commerce/commerceAdminProductRelations.spec.ts @@ -15,9 +15,9 @@ export const test = mergeTests(apiHelpersTest, commercePagesTest, loginTest()); test('LPD-13559 bulk actions for product relations', async ({ apiHelpers, - commerceProductAdminDetailsPage, - commerceProductAdminDetailsProductRelationsPage, - commerceProductAdminPage, + commerceAdminProductDetailsPage, + commerceAdminProductDetailsProductRelationsPage, + commerceAdminProductPage, page, }) => { await page.goto('/'); @@ -46,13 +46,13 @@ test('LPD-13559 bulk actions for product relations', async ({ ]); try { - await commerceProductAdminPage.gotoProduct(product1.name['en_US']); + await commerceAdminProductPage.gotoProduct(product1.name['en_US']); - await commerceProductAdminDetailsPage.goToProductRelations(); + await commerceAdminProductDetailsPage.goToProductRelations(); await expect( ( - await commerceProductAdminDetailsProductRelationsPage.tableRow( + await commerceAdminProductDetailsProductRelationsPage.tableRow( 2, product2.name['en_US'], true @@ -61,7 +61,7 @@ test('LPD-13559 bulk actions for product relations', async ({ ).toBeVisible(); await expect( ( - await commerceProductAdminDetailsProductRelationsPage.tableRow( + await commerceAdminProductDetailsProductRelationsPage.tableRow( 2, product3.name['en_US'], true @@ -69,16 +69,16 @@ test('LPD-13559 bulk actions for product relations', async ({ ).row ).toBeVisible(); - await commerceProductAdminDetailsProductRelationsPage.selectItemsInput.check(); + await commerceAdminProductDetailsProductRelationsPage.selectItemsInput.check(); await expect( - commerceProductAdminDetailsProductRelationsPage.deleteBulkButton + commerceAdminProductDetailsProductRelationsPage.deleteBulkButton ).toBeVisible(); - await commerceProductAdminDetailsProductRelationsPage.deleteBulkButton.click(); + await commerceAdminProductDetailsProductRelationsPage.deleteBulkButton.click(); await expect( - commerceProductAdminDetailsProductRelationsPage.emptyTableMessage + commerceAdminProductDetailsProductRelationsPage.emptyTableMessage ).toBeVisible(); } finally { diff --git a/modules/test/playwright/tests/commerce/commerceMiniCart.spec.ts b/modules/test/playwright/tests/commerce/commerceMiniCart.spec.ts index 8b6fe5ae020e36..71843e139c052b 100644 --- a/modules/test/playwright/tests/commerce/commerceMiniCart.spec.ts +++ b/modules/test/playwright/tests/commerce/commerceMiniCart.spec.ts @@ -59,9 +59,9 @@ test.afterEach(async ({apiHelpers}) => { test('mini cart bundle with UOM', async ({ apiHelpers, applicationsMenuPage, + commerceAdminProductPage, commerceLayoutsPage, commerceMiniCartPage, - commerceProductAdminPage, page, }) => { await apiHelpers.featureFlag.updateFeatureFlag('COMMERCE-9599', true); @@ -191,14 +191,14 @@ test('mini cart bundle with UOM', async ({ await applicationsMenuPage.goToProducts(); - await commerceProductAdminPage.managementToolbarSearchInput.fill( + await commerceAdminProductPage.managementToolbarSearchInput.fill( 'ProductBundle' ); - await commerceProductAdminPage.managementToolbarSearchInput.press('Enter'); + await commerceAdminProductPage.managementToolbarSearchInput.press('Enter'); await page.getByRole('link', {exact: true, name: 'ProductBundle'}).click(); - await commerceProductAdminPage.generateSkus(); + await commerceAdminProductPage.generateSkus(); await expect(page.getByText('Showing 1 to 5 of 5 entries.')).toBeVisible();