diff --git a/src/interfaces/BO/login/index.ts b/src/interfaces/BO/login/index.ts index b8bee851..b341ccad 100644 --- a/src/interfaces/BO/login/index.ts +++ b/src/interfaces/BO/login/index.ts @@ -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; + getLoginError(page: Page): Promise; + getResetPasswordSuccessMessage(page: Page): Promise; + sendResetPasswordLink(page: Page, email: string): Promise; successLogin(page: Page, email: string, password: string): Promise; } diff --git a/src/versions/develop/pages/BO/login/index.ts b/src/versions/develop/pages/BO/login/index.ts index bc2cab65..c0d6091c 100644 --- a/src/versions/develop/pages/BO/login/index.ts +++ b/src/versions/develop/pages/BO/login/index.ts @@ -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'; } /* @@ -137,7 +137,7 @@ class LoginPage extends BOBasePage implements LoginPageInterface { * @param page {Page} Browser tab * @return {Promise} */ - getLoginError(page: Page): Promise { + async getLoginError(page: Page): Promise { return this.getTextContent(page, this.alertDangerTextBlock); } @@ -179,7 +179,7 @@ class LoginPage extends BOBasePage implements LoginPageInterface { * @param page {Page} Browser tab * @returns {Promise} */ - getResetPasswordSuccessMessage(page: Page): Promise { + async getResetPasswordSuccessMessage(page: Page): Promise { return this.getTextContent(page, this.resetPasswordSuccessConfirmationText); } }