mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add page object files for e2e testing "forgot password"
This commit is contained in:
parent
3ae58ca6a9
commit
c23327013f
@ -0,0 +1,18 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
17
e2e-tests/cypress/tests/cypress/e2e/models/UserEMailSite.ts
Normal file
17
e2e-tests/cypress/tests/cypress/e2e/models/UserEMailSite.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user