diff --git a/src/interfaces/BO/design/positions/index.ts b/src/interfaces/BO/design/positions/index.ts index 2272192a..885b58bf 100644 --- a/src/interfaces/BO/design/positions/index.ts +++ b/src/interfaces/BO/design/positions/index.ts @@ -12,6 +12,7 @@ export interface BODesignPositionsPageInterface extends BOBasePagePageInterface getHookId(page: Page, hookRow: number): Promise; getHookName(page: Page, hookRow: number): Promise; getHookStatus(page: Page, hookRow: number): Promise; + getHookTitle(page: Page, hookRow: number): Promise; getModuleFilter(page: Page): Promise; getModulesInHook(page: Page, hookName: string): Promise; getNumberOfHooks(page: Page): Promise; diff --git a/src/versions/develop/pages/BO/design/positions/index.ts b/src/versions/develop/pages/BO/design/positions/index.ts index cd2a5aed..62d42863 100644 --- a/src/versions/develop/pages/BO/design/positions/index.ts +++ b/src/versions/develop/pages/BO/design/positions/index.ts @@ -7,7 +7,7 @@ import type {Page} from '@playwright/test'; * @class * @extends BOBasePage */ -class PositionsPage extends BOBasePage implements BODesignPositionsPageInterface { +class BODesignPositionsPage extends BOBasePage implements BODesignPositionsPageInterface { public readonly pageTitle: string; public readonly messageModuleAddedFromHook: string; @@ -46,6 +46,8 @@ class PositionsPage extends BOBasePage implements BODesignPositionsPageInterface private readonly hookHeaderNameSpan: (hookRow: number) => string; + private readonly hookHeaderHelpboxSpan: (hookRow: number) => string; + private readonly hookHeaderDescriptionDiv: (hookRow: number) => string; private readonly hookRowName: (hookName: string) => string; @@ -91,6 +93,7 @@ class PositionsPage extends BOBasePage implements BODesignPositionsPageInterface this.hookHeader = (hookRow: number) => `${this.hookRowNth(hookRow)} header`; this.hookHeaderStatusInput = (hookRow: number) => `${this.hookHeader(hookRow)} span.hook-status input.hook-switch-action`; this.hookHeaderNameSpan = (hookRow: number) => `${this.hookHeader(hookRow)} span.hook-name`; + this.hookHeaderHelpboxSpan = (hookRow: number) => `${this.hookHeader(hookRow)} span.help-box`; this.hookHeaderDescriptionDiv = (hookRow: number) => `${this.hookHeader(hookRow)} div.hook_description`; this.hookRowName = (hookName: string) => `${this.modulePositionFormHookSection} a[name=${hookName}]`; this.hookRowModulesList = (hookName: string) => `${this.hookRowName(hookName)} ~ section.module-list ul`; @@ -206,6 +209,16 @@ class PositionsPage extends BOBasePage implements BODesignPositionsPageInterface return this.getTextContent(page, this.hookHeaderDescriptionDiv(hookRow)); } + /** + * Return the hook title + * @param page {Page} Browser tab + * @param hookRow {number} Hook Row + * @returns {Promise} + */ + async getHookTitle(page: Page, hookRow: number): Promise { + return this.getAttributeContent(page, this.hookHeaderHelpboxSpan(hookRow), 'data-content'); + } + /** * Return the hook status * @param page {Page} Browser tab @@ -257,4 +270,4 @@ class PositionsPage extends BOBasePage implements BODesignPositionsPageInterface } } -module.exports = new PositionsPage(); +module.exports = new BODesignPositionsPage();