-
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.
Merge pull request #426 from Progi1984/modPsCheckPaymentBoMain
Migrate `@pages/BO/modules/psCheckPayment` from Core
- Loading branch information
Showing
4 changed files
with
92 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {ModuleConfigurationPageInterface} from '@interfaces/BO/modules/moduleConfiguration'; | ||
import {Page} from '@playwright/test'; | ||
|
||
export interface ModulePsCheckPaymentMainPageInterface extends ModuleConfigurationPageInterface { | ||
readonly pageTitle: string; | ||
|
||
saveFormContactDetails(page: Page): Promise<string>; | ||
setAddress(page: Page, address: string): Promise<void>; | ||
setPayee(page: Page, payee: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type {ModulePsCheckPaymentMainPageInterface} from '@interfaces/BO/modules/ps_checkpayment'; | ||
|
||
/* eslint-disable global-require, @typescript-eslint/no-require-imports */ | ||
function requirePage(): ModulePsCheckPaymentMainPageInterface { | ||
return require('@versions/develop/pages/BO/modules/ps_checkpayment'); | ||
} | ||
/* eslint-enable global-require, @typescript-eslint/no-require-imports */ | ||
|
||
export default requirePage(); |
72 changes: 72 additions & 0 deletions
72
src/versions/develop/pages/BO/modules/ps_checkpayment/index.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,72 @@ | ||
import {type ModulePsCheckPaymentMainPageInterface} from '@interfaces/BO/modules/ps_checkpayment'; | ||
import ModuleConfiguration from '@pages/BO/modules/moduleConfiguration'; | ||
import {Page} from '@playwright/test'; | ||
|
||
/** | ||
* Module configuration page for module : ps_checkpayment, contains selectors and functions for the page | ||
* @class | ||
* @extends ModuleConfiguration | ||
*/ | ||
class ModulePsCheckPaymentMainPage extends ModuleConfiguration implements ModulePsCheckPaymentMainPageInterface { | ||
public readonly pageTitle: string; | ||
|
||
private readonly configurationForm: string; | ||
|
||
private readonly payeeInput: string; | ||
|
||
private readonly addressInput: string; | ||
|
||
private readonly submitContactDetails: string; | ||
|
||
/** | ||
* @constructs | ||
* Setting up titles and selectors to use on page | ||
*/ | ||
constructor() { | ||
super(); | ||
this.pageTitle = 'Payments by check'; | ||
this.successfulUpdateMessage = 'Settings updated'; | ||
|
||
// Selectors | ||
// Customer Notifications | ||
this.configurationForm = '#configuration_form'; | ||
this.payeeInput = `${this.configurationForm} #CHEQUE_NAME`; | ||
this.addressInput = `${this.configurationForm} #CHEQUE_ADDRESS`; | ||
this.submitContactDetails = `${this.configurationForm} button[name="btnSubmit"]`; | ||
} | ||
|
||
/* Methods */ | ||
|
||
/** | ||
* Define the field "Payee" | ||
* @param page {Page} Browser tab | ||
* @param payee {string} | ||
* @returns {Promise<void>} | ||
*/ | ||
async setPayee(page: Page, payee: string): Promise<void> { | ||
return this.setInputValue(page, this.payeeInput, payee); | ||
} | ||
|
||
/** | ||
* Define the field "Address" | ||
* @param page {Page} Browser tab | ||
* @param address {string} | ||
* @returns {Promise<void>} | ||
*/ | ||
async setAddress(page: Page, address: string): Promise<void> { | ||
return this.setInputValue(page, this.addressInput, address); | ||
} | ||
|
||
/** | ||
* Save the "Contact details" form | ||
* @param page {Page} Browser tab | ||
* @returns {Promise<string>} | ||
*/ | ||
async saveFormContactDetails(page: Page): Promise<string> { | ||
await page.locator(this.submitContactDetails).click(); | ||
|
||
return this.getAlertSuccessBlockContent(page); | ||
} | ||
} | ||
|
||
module.exports = new ModulePsCheckPaymentMainPage(); |