-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boSearchAliasPage
: Adapt the page for v9
- Loading branch information
Showing
15 changed files
with
884 additions
and
478 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type SearchAliasCreator = { | ||
search?: string | ||
alias?: string | ||
result?: string | ||
}; | ||
|
||
export default SearchAliasCreator; |
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,29 @@ | ||
import {BOBasePagePageInterface} from '@interfaces/BO'; | ||
import {type Page} from '@playwright/test'; | ||
|
||
export interface BOSearchAliasPageInterface extends BOBasePagePageInterface { | ||
readonly errorFillFieldMessage: string; | ||
readonly errorMaxWordLengthInvalidMessage: string; | ||
readonly pageTitle: string; | ||
readonly settingsUpdateMessage: string; | ||
readonly successfulUpdateStatusMessage: string; | ||
readonly updateSuccessMessage: string; | ||
|
||
bulkDeleteAliases(page: Page): Promise<string>; | ||
bulkSetStatus(page: Page, enable?: boolean): Promise<string>; | ||
deleteAlias(page: Page, row: number): Promise<string>; | ||
filterTable(page: Page, filterType: string, filterBy: string, value: string): Promise<void>; | ||
getAllRowsColumnContent(page: Page, columnName: string): Promise<string[]>; | ||
getNumberOfElementInGrid(page: Page): Promise<number>; | ||
getStatus(page: Page, row: number): Promise<boolean>; | ||
getTextColumn(page: Page, row: number, columnName: string): Promise<string>; | ||
goToAddNewAliasPage(page: Page): Promise<void>; | ||
gotoEditAliasPage(page: Page, row: number): Promise<void>; | ||
paginationNext(page: Page): Promise<string>; | ||
paginationPrevious(page: Page): Promise<string>; | ||
resetAndGetNumberOfLines(page: Page): Promise<number>; | ||
resetFilter(page: Page): Promise<void>; | ||
selectPaginationLimit(page: Page, number: number): Promise<string>; | ||
setStatus(page: Page, row: number, valueWanted?: boolean): Promise<boolean>; | ||
sortTable(page: Page, sortBy: string, sortDirection: string): 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
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,16 @@ | ||
import type {BOSearchAliasPageInterface} from '@interfaces/BO/shopParameters/search/alias'; | ||
import testContext from '@utils/test'; | ||
import semver from 'semver'; | ||
|
||
const psVersion = testContext.getPSVersion(); | ||
|
||
/* eslint-disable global-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ | ||
function requirePage(): BOSearchAliasPageInterface { | ||
if (semver.lt(psVersion, '9.0.0')) { | ||
return require('@versions/8.2/pages/BO/shopParameters/search/alias'); | ||
} | ||
return require('@versions/develop/pages/BO/shopParameters/search/alias').boSearchAliasPage; | ||
} | ||
/* eslint-enable global-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ | ||
|
||
export default requirePage(); |
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
44 changes: 44 additions & 0 deletions
44
src/versions/8.2/pages/BO/shopParameters/search/alias/create.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,44 @@ | ||
import type FakerSearchAlias from '@data/faker/searchAlias'; | ||
import {BOAliasCreatePageInterface} from '@interfaces/BO/shopParameters/search/alias/create'; | ||
import { | ||
BOSearchAliasCreatePage as BOSearchAliasCreatePageVersion, | ||
} from '@versions/develop/pages/BO/shopParameters/search/alias/create'; | ||
import type {Page} from 'playwright'; | ||
|
||
/** | ||
* Search page, contains selectors and functions for the page | ||
* @class | ||
*/ | ||
class BOSearchAliasCreatePage extends BOSearchAliasCreatePageVersion implements BOAliasCreatePageInterface { | ||
/** | ||
* @constructs | ||
* Setting up titles and selectors to use on search page | ||
*/ | ||
constructor() { | ||
super(); | ||
|
||
this.pageTitleCreate = 'Search > Add new •'; | ||
this.pageTitleEdit = 'Search > Edit:'; | ||
|
||
// selectors | ||
this.aliasInput = '#alias'; | ||
this.resultInput = '#search'; | ||
this.saveButton = '#alias_form_submit_btn'; | ||
} | ||
|
||
/* Methods */ | ||
/** | ||
* Create/Edit alias | ||
* @param page {Page} Browser tab | ||
* @param aliasData {FakerSearchAlias} Data to set on alias form | ||
* @returns {Promise<string>} | ||
*/ | ||
async setAlias(page: Page, aliasData: FakerSearchAlias): Promise<string> { | ||
await this.setValue(page, this.aliasInput, aliasData.search); | ||
await this.setValue(page, this.resultInput, aliasData.alias); | ||
await page.locator(this.saveButton).click(); | ||
return this.getAlertSuccessBlockContent(page); | ||
} | ||
} | ||
|
||
module.exports = new BOSearchAliasCreatePage(); |
Oops, something went wrong.