diff --git a/e2e-tests/cypress/tests/cypress/e2e/models/ForgotPasswordPage.ts b/e2e-tests/cypress/tests/cypress/e2e/models/ForgotPasswordPage.ts new file mode 100644 index 000000000..295bb1fda --- /dev/null +++ b/e2e-tests/cypress/tests/cypress/e2e/models/ForgotPasswordPage.ts @@ -0,0 +1,18 @@ +/// + +export class ForgotPasswordPage { + // selectors + emailInput = "input[type=email]"; + submitBtn = "button[type=submit]"; + successComponent = "[data-test='forgot-password-success']"; + + enterEmail(email: string) { + cy.get(this.emailInput).clear().type(email); + return this; + } + + submitEmail() { + cy.get(this.submitBtn).click(); + return this; + } +} diff --git a/e2e-tests/cypress/tests/cypress/e2e/models/ResetPasswordPage.ts b/e2e-tests/cypress/tests/cypress/e2e/models/ResetPasswordPage.ts new file mode 100644 index 000000000..4f01d73b0 --- /dev/null +++ b/e2e-tests/cypress/tests/cypress/e2e/models/ResetPasswordPage.ts @@ -0,0 +1,32 @@ +/// + +export class ResetPasswordPage { + // selectors + newPasswordBlock = "#new-password-input-field"; + newPasswordRepeatBlock = "#repeat-new-password-input-field"; + resetPasswordBtn = "button[type=submit]"; + resetPasswordMessageBlock = '[data-test="reset-password-message"]'; + signinBtn = ".btn.test-message-button"; + + enterNewPassword(password: string) { + cy.get(this.newPasswordBlock).find("input[type=password]").type(password); + return this; + } + + repeatNewPassword(password: string) { + cy.get(this.newPasswordRepeatBlock) + .find("input[type=password]") + .type(password); + return this; + } + + submitNewPassword() { + cy.get(this.resetPasswordBtn).click(); + return this; + } + + openSigninPage() { + cy.get(this.signinBtn).click(); + return this; + } +} diff --git a/e2e-tests/cypress/tests/cypress/e2e/models/UserEMailSite.ts b/e2e-tests/cypress/tests/cypress/e2e/models/UserEMailSite.ts new file mode 100644 index 000000000..02207827d --- /dev/null +++ b/e2e-tests/cypress/tests/cypress/e2e/models/UserEMailSite.ts @@ -0,0 +1,17 @@ +/// + +export class UserEMailSite { + // selectors + emailInbox = ".sidebar-emails-container"; + emailList = ".email-list"; + emailMeta = ".email-meta"; + emailSubject = ".subject"; + + openRecentPasswordResetEMail() { + cy.get(this.emailList) + .find("email-item") + .filter(":contains(asswor)") + .click(); + expect(cy.get(this.emailSubject)).to("contain", "asswor"); + } +}