diff --git a/src/interfaces/BO/dashboard/index.ts b/src/interfaces/BO/dashboard/index.ts index f41f02df..b17b0e47 100644 --- a/src/interfaces/BO/dashboard/index.ts +++ b/src/interfaces/BO/dashboard/index.ts @@ -1,5 +1,47 @@ import {BOBasePagePageInterface} from '@interfaces/BO'; +import {type Page} from '@playwright/test'; export interface DashboardPageInterface extends BOBasePagePageInterface { readonly pageTitle: string; + + clickOnAbandonedCartsLink(page: Page): Promise; + clickOnActiveShoppingCartsLink(page: Page): Promise; + clickOnConfigureLink(page: Page): Promise; + clickOnConfigureProductsAndSalesLink(page: Page): Promise; + clickOnDetailsButtonOfRecentOrdersTable(page: Page, row?: number): Promise; + clickOnNewCustomersLink(page: Page): Promise; + clickOnNewMessagesLink(page: Page): Promise; + clickOnNewSubscriptionsLink(page: Page): Promise; + clickOnOrdersLink(page: Page): Promise; + clickOnOutOfStockProductsLink(page: Page): Promise; + clickOnProductReviewsLink(page: Page): Promise; + clickOnReturnExchangeLink(page: Page): Promise; + clickOnTotalSubscribersLink(page: Page): Promise; + clickOnVisitsLink(page: Page): Promise; + closeHelpCard(page: Page): Promise; + getBestSellersTabTitle(page: Page): Promise; + getHelpDocumentTitle(page: Page): Promise; + getMostViewedTabTitle(page: Page): Promise; + getNumberOfAbandonedCarts(page: Page): Promise; + getNumberOfActiveShoppingCarts(page: Page): Promise; + getNumberOfNewCustomers(page: Page): Promise; + getNumberOfNewMessages(page: Page): Promise; + getNumberOfNewSubscriptions(page: Page): Promise; + getNumberOfOrders(page: Page): Promise; + getNumberOfProductReviews(page: Page): Promise; + getNumberOfReturnExchange(page: Page): Promise; + getNumberOfTotalSubscribers(page: Page): Promise; + getNumberOfVisits(page: Page): Promise; + getOutOfStockProducts(page: Page): Promise; + getRecentOrdersTitle(page: Page): Promise; + getSalesScore(page: Page): Promise; + getTopSearchersTabTitle(page: Page): Promise; + goToBestSellersTab(page: Page): Promise; + goToMostViewedTab(page: Page): Promise; + goToTopSearchersTab(page: Page): Promise; + isBestSellersTableVisible(page: Page): Promise; + isMostViewedTableVisible(page: Page): Promise; + isTopSearchersTableVisible(page: Page): Promise; + openHelpCard(page: Page): Promise; + setDemoMode(page: Page, toEnable: boolean): Promise; } diff --git a/src/interfaces/BO/index.ts b/src/interfaces/BO/index.ts index d307563d..c342ec84 100644 --- a/src/interfaces/BO/index.ts +++ b/src/interfaces/BO/index.ts @@ -58,6 +58,8 @@ export interface BOBasePagePageInterface extends CommonPageInterface { readonly themeAndLogoParentLink: string; + readonly themeAndLogoLink: string + readonly emailThemeLink: string; readonly pagesLink: string; @@ -126,16 +128,36 @@ export interface BOBasePagePageInterface extends CommonPageInterface { readonly logsLink: string; - readonly authorizationServerLink: string; + readonly adminAPILink: string; readonly featureFlagLink: string; readonly securityLink: string; readonly multistoreLink: string; + readonly menuTree: { parent: string; children: string[] }[]; + clickOnNotification(page: Page, tabName: string, row?: number): Promise; + clickOnNotificationsLink(page: Page): Promise; + clickOnNotificationsTab(page: Page, tabName: string): Promise; + clickSubMenu(page: Page, parentSelector: string): Promise; closeSfToolBar(page: Frame | Page): Promise; + getAllNotificationsNumber(page: Page): Promise; + getNotificationsNumberInTab(page: Page, tabName: string): Promise; + goToMyProfile(page: Page): Promise; goToSubMenu(page: Page, parentSelector: string, linkSelector: string): Promise; + isMobileMenuVisible(page: Page): Promise; + isNavbarVisible(page: Page): Promise; + isSidebarCollapsed(page: Page): Promise; + isSubMenuActive(page: Page, linkSelector: string): Promise; + isSubmenuVisible(page: Page, parentSelector: string, linkSelector: string): Promise; logoutBO(page: Page): Promise; + navigateToPageWithInvalidToken(page: Page, url: string, continueToPage?: boolean): Promise; + quickAccessToPage(page: Page, linkName: string): Promise; + quickAccessToPageNewWindow(page: Page, linkName: string): Promise; + quickAccessToPageWithFrame(page: Page, linkName: string): Promise; + resize(page: Page, mobileSize: boolean): Promise; + search(page: Page, query: string): Promise; + setSidebarCollapsed(page: Page, isCollapsed: boolean): Promise; viewMyShop(page: Page): Promise; } diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts index b0c6803d..0d54a21b 100644 --- a/src/interfaces/index.ts +++ b/src/interfaces/index.ts @@ -6,4 +6,6 @@ export interface CommonPageInterface { getPageTitle(page: Page): Promise; goTo(page: Page, url: string): Promise; goToFo(page: Page): Promise; + reloadPage(page: Page): Promise; + resize(page: Page, mobileSize: boolean): Promise; } diff --git a/src/pages/BO/BOBasePage.ts b/src/pages/BO/BOBasePage.ts index 76788a4e..a28642d6 100644 --- a/src/pages/BO/BOBasePage.ts +++ b/src/pages/BO/BOBasePage.ts @@ -1,4 +1,5 @@ // Import pages +import {type BOBasePagePageInterface} from '@interfaces/BO'; import CommonPage from '@pages/commonPage'; import {Frame, Page} from '@playwright/test'; @@ -11,7 +12,7 @@ import semver from 'semver'; * @class * @extends CommonPage */ -export default class BOBasePage extends CommonPage { +export default class BOBasePage extends CommonPage implements BOBasePagePageInterface { public successfulCreationMessage: string; public successfulUpdateMessage: string; @@ -136,6 +137,8 @@ export default class BOBasePage extends CommonPage { public readonly themeAndLogoParentLink: string; + public readonly themeAndLogoLink: string; + public readonly emailThemeLink: string; public readonly pagesLink: string; @@ -204,7 +207,7 @@ export default class BOBasePage extends CommonPage { public readonly logsLink: string; - public readonly authorizationServerLink: string; + public readonly adminAPILink: string; public readonly featureFlagLink: string; @@ -403,6 +406,7 @@ export default class BOBasePage extends CommonPage { this.designParentLink = '#subtab-AdminParentThemes'; // Theme & Logo this.themeAndLogoParentLink = '#subtab-AdminThemesParent'; + this.themeAndLogoLink = '#subtab-AdminThemes'; // Email theme this.emailThemeLink = '#subtab-AdminParentMailTheme'; // Pages @@ -475,7 +479,7 @@ export default class BOBasePage extends CommonPage { // Logs this.logsLink = '#subtab-AdminLogs'; // Authorization Server - this.authorizationServerLink = '#subtab-AdminAuthorizationServer'; + this.adminAPILink = '#subtab-AdminAdminAPI'; // New & Experimental Features this.featureFlagLink = '#subtab-AdminFeatureFlag'; // Security @@ -612,8 +616,8 @@ export default class BOBasePage extends CommonPage { this.helpDocumentURL = `${this.rightSidebar} div.quicknav-scroller._fullspace object`; // Invalid token block - this.invalidTokenContinueLink = 'a.btn-continue'; - this.invalidTokenCancelLink = 'a.btn-cancel'; + this.invalidTokenContinueLink = '#security-compromised-page #csrf-white-container div a:nth-child(1)'; + this.invalidTokenCancelLink = '#security-compromised-page #csrf-white-container div a:nth-child(2)'; } /* diff --git a/src/versions/develop/pages/BO/dashboard/index.ts b/src/versions/develop/pages/BO/dashboard/index.ts index 46f73df1..18c1b2e3 100644 --- a/src/versions/develop/pages/BO/dashboard/index.ts +++ b/src/versions/develop/pages/BO/dashboard/index.ts @@ -159,14 +159,14 @@ class Dashboard extends BOBasePage implements DashboardPageInterface { this.dashboardLiveSection = '#dash_live span.data_label'; this.onlineVisitorLink = `${this.dashboardLiveSection} a[href*='controller=AdminStats']`; this.onlineVisitorsNumber = '#online_visitor'; - this.activeShoppingCartsLink = `${this.dashboardLiveSection} a[href*='controller=AdminCarts']`; + this.activeShoppingCartsLink = `${this.dashboardLiveSection} a[href*='sell/orders/carts/?']`; this.activeShoppingCartNumber = '#active_shopping_cart'; this.dashboardPendingSection = '#dash_pending span.data_label'; - this.dashboardOrdersLink = `${this.dashboardPendingSection} a[href*='sell/orders']`; + this.dashboardOrdersLink = `${this.dashboardPendingSection} a[href*='sell/orders/?']`; this.ordersNumber = '#pending_orders'; this.returnExchangeLink = `${this.dashboardPendingSection} a[href*='controller=AdminReturn']`; this.returnExchangeNumber = '#return_exchanges'; - this.abandonedCartsLink = `${this.dashboardPendingSection} a[href*='controller=AdminCarts']`; + this.abandonedCartsLink = `${this.dashboardPendingSection} a[href*='sell/orders/carts/?']`; this.abandonedCartsNumber = '#abandoned_cart'; this.outOfStockProductsLink = `${this.dashboardPendingSection} a[href*='catalog/monitoring']`; this.outOfStockProductsNumber = '#products_out_of_stock';