-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@pages/BO/modules/moduleManager : Add router to go to the ModuleManager
- Loading branch information
Showing
11 changed files
with
148 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type {BOBasePagePageInterface} from '@interfaces/BO/index'; | ||
import type {Frame, Page} from '@playwright/test'; | ||
|
||
export interface BORouterPageInterface extends BOBasePagePageInterface { | ||
goToModuleManagerPage(page: Page): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {BORouterPageInterface} from '@interfaces/BO/router'; | ||
import BOBasePage from '@pages/BO/BOBasePage'; | ||
import boDashboardPage from '@pages/BO/dashboard/index'; | ||
import boModuleManagerPage from '@pages/BO/modules/moduleManager/index'; | ||
import boModuleManagerSelectionPage from '@pages/BO/modules/moduleManager/selection'; | ||
import testContext from '@utils/testContext'; | ||
Check failure on line 6 in src/pages/BO/BORouterPage.ts GitHub Actions / TypeScript Check
|
||
import type {Page} from 'playwright-core'; | ||
import semver from 'semver'; | ||
|
||
class BORouterPage extends BOBasePage implements BORouterPageInterface { | ||
async goToModuleManagerPage(page: Page): Promise<void> { | ||
const psVersion = testContext.getPSVersion(); | ||
const pageTitle = await this.getPageTitle(page); | ||
const boModuleManagerLinkPageTitle = semver.lt(psVersion, '7.4.0') | ||
? boModuleManagerSelectionPage.pageTitle | ||
: boModuleManagerPage.pageTitle; | ||
|
||
// Check if we are not already on the page | ||
if (!pageTitle.includes(boModuleManagerLinkPageTitle)) { | ||
await boDashboardPage.goToSubMenu( | ||
page, | ||
boDashboardPage.modulesParentLink, | ||
boDashboardPage.moduleManagerLink, | ||
); | ||
await boDashboardPage.closeSfToolBar(page); | ||
} | ||
|
||
if (semver.lt(psVersion, '7.4.0')) { | ||
console.log('goToTabInstalledModules'); | ||
await boModuleManagerSelectionPage.goToTabInstalledModules(page); | ||
} | ||
} | ||
} | ||
|
||
export default new BORouterPage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/versions/1.7.3/pages/BO/modules/moduleManager/selection.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import {ModuleManagerSelectionPageInterface} from '@interfaces/BO/modules/moduleManager/selection'; | ||
import {Page} from '@playwright/test'; | ||
import {SelectionPage} from '@versions/1.7.4/pages/BO/modules/moduleManager/selection'; | ||
|
||
/** | ||
* @class | ||
* @extends BOBasePage | ||
*/ | ||
class SelectionPageVersion extends SelectionPage implements ModuleManagerSelectionPageInterface { | ||
/** | ||
* @constructs | ||
* Setting up titles and selectors to use on module catalog page | ||
*/ | ||
constructor() { | ||
super(); | ||
|
||
// Selectors | ||
this.subTabSelection = '#head_tabs a.tab:nth-child(1)'; | ||
this.subTabInstalledModules = '#head_tabs a.tab:nth-child(2)'; | ||
} | ||
|
||
/** | ||
* Go to the "Selection" tab | ||
* @param {Page} page | ||
* @returns {Promise<void>} | ||
*/ | ||
async goToTabSelection(page: Page): Promise<void> { | ||
await this.waitForSelectorAndClick(page, this.subTabSelection); | ||
await this.waitForVisibleSelector(page, `${this.subTabSelection}.current`, 2000); | ||
} | ||
|
||
/** | ||
* Go to the "Installed Modules" tab | ||
* @param {Page} page | ||
* @returns {Promise<void>} | ||
*/ | ||
async goToTabInstalledModules(page: Page): Promise<void> { | ||
await this.waitForSelectorAndClick(page, this.subTabInstalledModules); | ||
await this.waitForVisibleSelector(page, `${this.subTabInstalledModules}.current`, 2000); | ||
} | ||
} | ||
|
||
module.exports = new SelectionPageVersion(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters