Skip to content

Commit

Permalink
Merge pull request #240 from shopware/next-39784/add-and-fix-some-loc…
Browse files Browse the repository at this point in the history
…ators-on-AccountProfile-and-AccountLogin

fix: NEXT-39784 - fix and add some locators to AccountProfile and Acc…
  • Loading branch information
ocavli authored Dec 18, 2024
2 parents 2c7d7fc + 6217445 commit 275f54f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 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 @@ -8,6 +8,7 @@ export class AccountLogin implements PageObject {
public readonly loginButton: Locator;
public readonly logoutLink: Locator;
public readonly successAlert: Locator;
public readonly invalidCredentialsAlert: Locator;

// Inputs for registration
public readonly personalFormArea: Locator;
Expand All @@ -33,6 +34,7 @@ export class AccountLogin implements PageObject {
this.loginButton = page.getByRole('button', { name: 'Log in' });
this.forgotPasswordLink = page.getByRole('link', { name: 'I have forgotten my password.' });
this.logoutLink = page.getByRole('link', { name: 'Log out'});
this.invalidCredentialsAlert = page.getByText('Could not find an account that matches the given credentials.');

this.personalFormArea = page.locator('.register-personal');
this.billingAddressFormArea = page.locator('.register-billing');
Expand Down
12 changes: 9 additions & 3 deletions src/page-objects/storefront/AccountProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export class AccountProfile implements PageObject {

public readonly emailUpdateMessage: Locator;
public readonly passwordUpdateMessage: Locator;
public readonly emailValidationAlert: Locator;
public readonly emailUpdateFailureAlert: Locator;
public readonly passwordUpdateFailureAlert: Locator;

constructor(public readonly page: Page) {
this.salutationSelect = page.getByLabel('Salutation');
Expand All @@ -30,20 +33,23 @@ export class AccountProfile implements PageObject {
this.saveProfileButton = page.locator('#profilePersonalForm').getByRole('button', { name: 'Save changes' })

this.changeEmailButton = page.getByRole('button', { name: 'Change email address' });
this.emailAddressInput = page.getByLabel('Email address');
this.emailAddressInput = page.locator('input[id="personalMail"]');
this.emailAddressConfirmInput = page.getByLabel('Email address confirmation');
this.emailConfirmPasswordInput = page.locator('input[id="personalMailPasswordCurrent"]');
this.saveEmailAddressButton = page.locator('#profileMailForm').getByRole('button', { name: 'Save changes' });

this.changePasswordButton = page.getByRole('button', { name: 'Change password' });
this.newPasswordInput = page.locator('input[id="newPassword"]');
this.newPasswordConfirmInput = page.locator('input[id="newPasswordConfirmation"]');
this.currentPasswordInput = page.locator('input[id="passwordCurrent"]');
this.newPasswordConfirmInput = page.locator('input[id="passwordConfirmation"]');
this.currentPasswordInput = page.locator('input[id="password"]');
this.saveNewPasswordButton = page.locator('#profilePasswordForm').getByRole('button', { name: 'Save changes' });
this.loginDataEmailAddress = page.locator('.account-profile-mail');

this.emailUpdateMessage = page.getByText('Your email address has been updated.');
this.passwordUpdateMessage = page.getByText('Your password has been updated.');
this.emailValidationAlert = page.locator('.was-validated');
this.emailUpdateFailureAlert = page.getByText('Email address could not be changed.');
this.passwordUpdateFailureAlert = page.getByText('Password could not be changed.');
}

url() {
Expand Down

0 comments on commit 275f54f

Please sign in to comment.