keycloak-scim/cypress/support/pages/admin_console/manage/users/UserDetailsPage.ts
Marco 2276311334
Credentials Reset Flow (#1699)
* Add credential reset modal

* Add i18n labels

* Refactor to align with marvelapp mockup
TODO: tests

* Add e2e tests

* Implement code review change requests
Add menuAppendTo to CredentialResetActionMultiSelect -> Select component
Add optional menuAppendTo prop to TimeSelectorComponent
Refactor CredentialsPage constructor
2021-12-21 07:22:44 +01:00

54 lines
1.5 KiB
TypeScript

import { RequiredActionAlias } from "@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation";
export default class UserDetailsPage {
saveBtn: string;
cancelBtn: string;
emailInput: string;
emailValue: () => string;
firstNameInput: string;
firstNameValue: string;
lastNameInput: string;
lastNameValue: string;
enabledSwitch: string;
enabledValue: boolean;
requiredUserActions: RequiredActionAlias[];
constructor() {
this.saveBtn = "save-user";
this.cancelBtn = "cancel-create-user";
this.emailInput = "email-input";
this.emailValue = () =>
"example" +
"_" +
(Math.random() + 1).toString(36).substring(7) +
"@example.com";
this.firstNameInput = "firstName-input";
this.firstNameValue = "firstname";
this.lastNameInput = "lastName-input";
this.lastNameValue = "lastname";
this.enabledSwitch = "user-enabled-switch";
this.enabledValue = true;
this.requiredUserActions = [RequiredActionAlias.UPDATE_PASSWORD];
}
fillUserData() {
cy.findByTestId(this.emailInput).type(this.emailValue());
cy.findByTestId(this.firstNameInput).type(this.firstNameValue);
cy.findByTestId(this.lastNameInput).type(this.lastNameValue);
cy.findByTestId(this.enabledSwitch).check({ force: true });
return this;
}
save() {
cy.findByTestId(this.saveBtn).click();
return this;
}
cancel() {
cy.findByTestId(this.cancelBtn).click();
return this;
}
}