refactor naming in reset password page model

This commit is contained in:
mahula 2023-03-02 10:52:24 +01:00
parent 84b031c967
commit 2ded17348a
2 changed files with 6 additions and 6 deletions

View File

@ -2,19 +2,19 @@
export class ResetPasswordPage { export class ResetPasswordPage {
// selectors // selectors
newPasswordBlock = '#new-password-input-field' newPasswordInput = '#new-password-input-field'
newPasswordRepeatBlock = '#repeat-new-password-input-field' newPasswordRepeatInput = '#repeat-new-password-input-field'
resetPasswordBtn = 'button[type=submit]' resetPasswordBtn = 'button[type=submit]'
resetPasswordMessageBlock = '[data-test="reset-password-message"]' resetPasswordMessageBlock = '[data-test="reset-password-message"]'
signinBtn = '.btn.test-message-button' signinBtn = '.btn.test-message-button'
enterNewPassword(password: string) { enterNewPassword(password: string) {
cy.get(this.newPasswordBlock).find('input[type=password]').type(password) cy.get(this.newPasswordInput).find('input[type=password]').type(password)
return this return this
} }
repeatNewPassword(password: string) { repeatNewPassword(password: string) {
cy.get(this.newPasswordRepeatBlock) cy.get(this.newPasswordRepeatInput)
.find('input[type=password]') .find('input[type=password]')
.type(password) .type(password)
return this return this

View File

@ -74,12 +74,12 @@ When('the user opens the password reset link in the browser', () => {
cy.task('getResetPasswordLink').then((passwordResetLink) => { cy.task('getResetPasswordLink').then((passwordResetLink) => {
cy.visit(passwordResetLink) cy.visit(passwordResetLink)
}) })
cy.get(resetPasswordPage.newPasswordRepeatBlock).should('be.visible') cy.get(resetPasswordPage.newPasswordInput).should('be.visible')
}) })
When('the user opens the activation link in the browser', () => { When('the user opens the activation link in the browser', () => {
cy.task('getActivationLink').then((activationLink) => { cy.task('getActivationLink').then((activationLink) => {
cy.visit(activationLink) cy.visit(activationLink)
}) })
cy.get(resetPasswordPage.newPasswordRepeatBlock).should('be.visible') cy.get(resetPasswordPage.newPasswordInput).should('be.visible')
}) })