keycloak-scim/cypress/support/pages/admin_console/manage/groups/GroupModal.ts

35 lines
706 B
TypeScript
Raw Normal View History

export default class GroupModal {
private nameInput = "groupNameInput";
private createButton = "createGroup";
private renameButton = "renameGroup";
open(name?: string) {
if (name) {
cy.getId(name).click();
} else {
cy.get("button").contains("Create").click();
}
return this;
}
fillGroupForm(name = "") {
2021-05-07 10:12:31 +00:00
cy.getId(this.nameInput).clear().type(name);
return this;
}
clickCreate() {
2021-05-20 15:38:10 +00:00
cy.intercept("/auth/admin/realms/master/groups/*/members").as(
"groupCreate"
);
cy.getId(this.createButton).click();
2021-05-20 15:38:10 +00:00
cy.wait(["@groupCreate"]);
return this;
}
clickRename() {
cy.getId(this.renameButton).click();
return this;
}
}