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