Skip to content

Commit

Permalink
Enable boLoginPage in the Core
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed May 21, 2024
1 parent 0b35cd7 commit 228eb1c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/interfaces/BO/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import type {Page} from '@playwright/test';

export interface LoginPageInterface extends BOBasePagePageInterface {
readonly pageTitle: string;
readonly loginErrorText: string;
readonly resetPasswordSuccessText: string;

failedLogin(page: Page, email: string, password: string): Promise<void>;
getLoginError(page: Page): Promise<string>;
getResetPasswordSuccessMessage(page: Page): Promise<string>;
sendResetPasswordLink(page: Page, email: string): Promise<void>;
successLogin(page: Page, email: string, password: string): Promise<void>;
}
14 changes: 7 additions & 7 deletions src/versions/develop/pages/BO/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ class LoginPage extends BOBasePage implements LoginPageInterface {
constructor() {
super();

this.pageTitle = 'PrestaShop';
this.pageTitle = global.INSTALL.SHOP_NAME;
this.loginErrorText = 'The employee does not exist, or the password provided is incorrect.';
this.resetPasswordSuccessText = 'Please, check your mailbox.';

this.emailInput = '#email';
this.passwordInput = '#passwd';
this.submitLoginButton = '#submit_login';
this.alertDangerDiv = '#error';
this.alertDangerDiv = '.alert-danger .alert-text';
this.alertDangerTextBlock = `${this.alertDangerDiv} p`;
// reset password selectors
this.forgotPasswordLink = '#forgot-password-link';
this.resetPasswordEmailFormField = '#email_forgot';
this.resetPasswordButton = '#reset-password-button';
this.resetPasswordSuccessConfirmationText = '#forgot_confirm_name';
this.resetPasswordEmailFormField = '#request_password_reset_email_forgot';
this.resetPasswordButton = '#request_password_reset_buttons_submit_login';
this.resetPasswordSuccessConfirmationText = '.alert-info .alert-text p';
}

/*
Expand Down Expand Up @@ -137,7 +137,7 @@ class LoginPage extends BOBasePage implements LoginPageInterface {
* @param page {Page} Browser tab
* @return {Promise<string>}
*/
getLoginError(page: Page): Promise<string> {
async getLoginError(page: Page): Promise<string> {
return this.getTextContent(page, this.alertDangerTextBlock);
}

Expand Down Expand Up @@ -179,7 +179,7 @@ class LoginPage extends BOBasePage implements LoginPageInterface {
* @param page {Page} Browser tab
* @returns {Promise<string>}
*/
getResetPasswordSuccessMessage(page: Page): Promise<string> {
async getResetPasswordSuccessMessage(page: Page): Promise<string> {
return this.getTextContent(page, this.resetPasswordSuccessConfirmationText);
}
}
Expand Down

0 comments on commit 228eb1c

Please sign in to comment.