2021-12-21 06:22:44 +00:00
|
|
|
export default class CredentialsPage {
|
|
|
|
private readonly credentialsTab = "credentials";
|
|
|
|
private readonly emptyStatePasswordBtn = "no-credentials-empty-action";
|
|
|
|
private readonly emptyStateResetBtn = "credential-reset-empty-action";
|
|
|
|
private readonly resetBtn = "credentialResetBtn";
|
2022-02-09 14:39:10 +00:00
|
|
|
private readonly setPasswordBtn = "confirm";
|
2021-12-21 06:22:44 +00:00
|
|
|
private readonly credentialResetModal = "credential-reset-modal";
|
|
|
|
private readonly resetModalActionsToggleBtn =
|
|
|
|
"[data-testid=credential-reset-modal] #actions";
|
2022-01-03 07:11:07 +00:00
|
|
|
private readonly passwordField = "passwordField";
|
|
|
|
private readonly passwordConfirmationField = "passwordConfirmationField";
|
2021-12-21 06:22:44 +00:00
|
|
|
private readonly resetActions = [
|
|
|
|
"VERIFY_EMAIL-option",
|
|
|
|
"UPDATE_PROFILE-option",
|
|
|
|
"CONFIGURE_TOTP-option",
|
|
|
|
"UPDATE_PASSWORD-option",
|
|
|
|
"terms_and_conditions-option",
|
|
|
|
];
|
2022-02-09 14:39:10 +00:00
|
|
|
private readonly confirmationButton = "confirm";
|
2022-03-07 14:32:34 +00:00
|
|
|
private readonly editLabelBtn = "editUserLabelBtn";
|
|
|
|
private readonly labelField = "userLabelFld";
|
|
|
|
private readonly editConfirmationBtn = "editUserLabelAcceptBtn";
|
|
|
|
private readonly showDataDialogBtn = "showDataBtn";
|
|
|
|
private readonly closeDataDialogBtn = '[aria-label^="Close"]';
|
2021-12-21 06:22:44 +00:00
|
|
|
|
|
|
|
goToCredentialsTab() {
|
|
|
|
cy.findByTestId(this.credentialsTab).click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
clickEmptyStatePasswordBtn() {
|
|
|
|
cy.findByTestId(this.emptyStatePasswordBtn).click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickEmptyStateResetBtn() {
|
|
|
|
cy.findByTestId(this.emptyStateResetBtn).click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickResetBtn() {
|
|
|
|
cy.findByTestId(this.resetBtn).click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickResetModalActionsToggleBtn() {
|
|
|
|
cy.get(this.resetModalActionsToggleBtn).click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickResetModalAction(index: number) {
|
|
|
|
cy.findByTestId(this.resetActions[index]).click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickConfirmationBtn() {
|
|
|
|
cy.findByTestId(this.confirmationButton).dblclick();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
fillPasswordForm() {
|
2022-01-03 07:11:07 +00:00
|
|
|
cy.findByTestId(this.passwordField).type("test");
|
|
|
|
cy.findByTestId(this.passwordConfirmationField).type("test");
|
2021-12-21 06:22:44 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
fillResetCredentialForm() {
|
|
|
|
cy.findByTestId(this.credentialResetModal);
|
|
|
|
this.clickResetModalActionsToggleBtn()
|
|
|
|
.clickResetModalAction(2)
|
|
|
|
.clickResetModalAction(3)
|
|
|
|
.clickConfirmationBtn();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickSetPasswordBtn() {
|
|
|
|
cy.findByTestId(this.setPasswordBtn).click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
2022-03-07 14:32:34 +00:00
|
|
|
|
|
|
|
clickEditCredentialLabelBtn() {
|
|
|
|
cy.findByTestId(this.editLabelBtn)
|
|
|
|
.should("be.visible")
|
|
|
|
.click({ force: true });
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
fillEditCredentialForm() {
|
|
|
|
cy.findByTestId(this.labelField).focus().type("test");
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickEditConfirmationBtn() {
|
|
|
|
cy.findByTestId(this.editConfirmationBtn).click();
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickShowDataDialogBtn() {
|
|
|
|
cy.findByTestId(this.showDataDialogBtn)
|
|
|
|
.should("be.visible")
|
|
|
|
.click({ force: true });
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickCloseDataDialogBtn() {
|
|
|
|
cy.get(this.closeDataDialogBtn).eq(1).click({ force: true });
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
2021-12-21 06:22:44 +00:00
|
|
|
}
|