Skip to content

Commit

Permalink
fix: add AccountRecover and AccountLogin objects for forgot password
Browse files Browse the repository at this point in the history
  • Loading branch information
vanpham-sw committed Dec 18, 2024
1 parent f284d0f commit b3ece55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/page-objects/storefront/AccountLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
6 changes: 6 additions & 0 deletions src/page-objects/storefront/AccountRecover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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() {
Expand Down

0 comments on commit b3ece55

Please sign in to comment.