From b3ece555fa56c10cc7782c91a785a22e659de97c Mon Sep 17 00:00:00 2001 From: vanpham-sw Date: Wed, 18 Dec 2024 16:38:41 +0700 Subject: [PATCH] fix: add AccountRecover and AccountLogin objects for forgot password --- src/page-objects/storefront/AccountLogin.ts | 2 ++ src/page-objects/storefront/AccountRecover.ts | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/page-objects/storefront/AccountLogin.ts b/src/page-objects/storefront/AccountLogin.ts index 7b9a602..ab92621 100644 --- a/src/page-objects/storefront/AccountLogin.ts +++ b/src/page-objects/storefront/AccountLogin.ts @@ -9,6 +9,7 @@ export class AccountLogin implements PageObject { public readonly logoutLink: Locator; public readonly successAlert: Locator; public readonly invalidCredentialsAlert: Locator; + public readonly passwordUpdatedAlert: Locator; // Inputs for registration public readonly personalFormArea: Locator; @@ -54,6 +55,7 @@ export class AccountLogin implements PageObject { this.registerButton = page.getByRole('button', { name: 'Continue' }); this.logoutLink = page.getByRole('link', { name: 'Log out'}); this.successAlert = page.getByText('Successfully logged out.'); + this.passwordUpdatedAlert = page.getByText('Your password has been updated.'); } url() { diff --git a/src/page-objects/storefront/AccountRecover.ts b/src/page-objects/storefront/AccountRecover.ts index 69f1e73..8ff6e17 100644 --- a/src/page-objects/storefront/AccountRecover.ts +++ b/src/page-objects/storefront/AccountRecover.ts @@ -9,6 +9,9 @@ export class AccountRecover implements PageObject { public readonly requestEmailButton: Locator; public readonly backButton: Locator; public readonly passwordResetEmailSentMessage: Locator; + public readonly newPasswordInput: Locator; + public readonly newPasswordConfirmInput: Locator; + public readonly changePasswordButton: Locator; constructor(public readonly page: Page) { this.passwordRecoveryForm = page.locator('.account-recover-password-form'); @@ -19,6 +22,9 @@ export class AccountRecover implements PageObject { this.requestEmailButton = this.passwordRecoveryForm.getByRole('button', { name: 'Request email' }); this.backButton = this.passwordRecoveryForm.getByRole('link', { name: 'Back' }); this.passwordResetEmailSentMessage = page.getByText('If the provided email address is registered, a confirmation email including a password reset link has been sent.'); + this.newPasswordInput = page.getByLabel('New password'); + this.newPasswordConfirmInput = page.getByLabel('Password confirmation'); + this.changePasswordButton = page.getByRole('button', { name: 'Change password' }); } url() {