2023-06-20 12:21:49 +00:00
|
|
|
import { v4 as uuid } from "uuid";
|
2022-12-07 15:28:28 +00:00
|
|
|
import GroupModal from "../support/pages/admin-ui/manage/groups/GroupModal";
|
|
|
|
import GroupDetailPage from "../support/pages/admin-ui/manage/groups/group_details/GroupDetailPage";
|
|
|
|
import AttributesTab from "../support/pages/admin-ui/manage/AttributesTab";
|
|
|
|
import { SearchGroupPage } from "../support/pages/admin-ui/manage/groups/SearchGroupPage";
|
|
|
|
import SidebarPage from "../support/pages/admin-ui/SidebarPage";
|
2021-03-01 15:06:04 +00:00
|
|
|
import LoginPage from "../support/pages/LoginPage";
|
2022-01-07 07:27:58 +00:00
|
|
|
import { keycloakBefore } from "../support/util/keycloak_hooks";
|
2022-12-07 15:28:28 +00:00
|
|
|
import GroupPage from "../support/pages/admin-ui/manage/groups/GroupPage";
|
|
|
|
import ChildGroupsTab from "../support/pages/admin-ui/manage/groups/group_details/tabs/ChildGroupsTab";
|
|
|
|
import MembersTab from "../support/pages/admin-ui/manage/groups/group_details/tabs/MembersTab";
|
2022-06-27 08:47:41 +00:00
|
|
|
import adminClient from "../support/util/AdminClient";
|
|
|
|
import { range } from "lodash-es";
|
2022-12-07 15:28:28 +00:00
|
|
|
import RoleMappingTab from "../support/pages/admin-ui/manage/RoleMappingTab";
|
2022-09-14 10:44:30 +00:00
|
|
|
import CommonPage from "../support/pages/CommonPage";
|
2021-03-01 15:06:04 +00:00
|
|
|
|
|
|
|
describe("Group test", () => {
|
|
|
|
const loginPage = new LoginPage();
|
|
|
|
const sidebarPage = new SidebarPage();
|
2021-03-24 14:07:49 +00:00
|
|
|
const groupModal = new GroupModal();
|
2021-03-29 11:37:47 +00:00
|
|
|
const searchGroupPage = new SearchGroupPage();
|
2021-10-25 14:38:54 +00:00
|
|
|
const attributesTab = new AttributesTab();
|
2022-06-27 08:47:41 +00:00
|
|
|
const groupPage = new GroupPage();
|
|
|
|
const groupDetailPage = new GroupDetailPage();
|
|
|
|
const childGroupsTab = new ChildGroupsTab();
|
|
|
|
const membersTab = new MembersTab();
|
2022-09-14 10:44:30 +00:00
|
|
|
const commonPage = new CommonPage();
|
2022-06-27 08:47:41 +00:00
|
|
|
|
|
|
|
const groupNamePrefix = "group_";
|
|
|
|
let groupName: string;
|
|
|
|
const groupNames: string[] = [];
|
|
|
|
const predefinedGroups = ["level", "level1", "level2", "level3"];
|
|
|
|
const emptyGroup = "empty-group";
|
|
|
|
let users: { id: string; username: string }[] = [];
|
|
|
|
const username = "test-user";
|
|
|
|
|
|
|
|
before(async () => {
|
|
|
|
users = await Promise.all(
|
|
|
|
range(5).map((index) => {
|
|
|
|
const user = adminClient
|
|
|
|
.createUser({
|
|
|
|
username: username + index,
|
|
|
|
enabled: true,
|
|
|
|
})
|
|
|
|
.then((user) => {
|
2023-04-13 13:55:50 +00:00
|
|
|
return { id: user.id!, username: username + index };
|
2022-06-27 08:47:41 +00:00
|
|
|
});
|
|
|
|
return user;
|
2023-07-11 14:03:21 +00:00
|
|
|
}),
|
2022-06-27 08:47:41 +00:00
|
|
|
);
|
|
|
|
});
|
2021-03-01 15:06:04 +00:00
|
|
|
|
2024-05-30 11:46:21 +00:00
|
|
|
after(
|
|
|
|
async () =>
|
|
|
|
await Promise.all([
|
|
|
|
adminClient.deleteGroups(),
|
|
|
|
...range(5).map((index) => adminClient.deleteUser(username + index)),
|
|
|
|
]),
|
|
|
|
);
|
2022-08-12 10:52:41 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
beforeEach(() => {
|
|
|
|
loginPage.logIn();
|
2023-02-10 10:10:35 +00:00
|
|
|
keycloakBefore();
|
2022-06-27 08:47:41 +00:00
|
|
|
sidebarPage.goToGroups();
|
2023-06-20 12:21:49 +00:00
|
|
|
groupName = groupNamePrefix + uuid();
|
2022-06-27 08:47:41 +00:00
|
|
|
groupNames.push(groupName);
|
|
|
|
});
|
2021-05-18 12:25:46 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
describe("List", () => {
|
|
|
|
it("Create group from empty option", () => {
|
|
|
|
groupPage
|
|
|
|
.assertNoGroupsInThisRealmEmptyStateMessageExist(true)
|
|
|
|
.createGroup(groupName, true)
|
|
|
|
.assertNotificationGroupCreated()
|
2022-09-15 18:12:20 +00:00
|
|
|
.searchGroup(groupName, true)
|
2022-06-27 08:47:41 +00:00
|
|
|
.assertGroupItemExist(groupName, true);
|
2021-03-01 15:06:04 +00:00
|
|
|
});
|
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Create group from search bar", () => {
|
|
|
|
groupPage
|
|
|
|
.assertNoGroupsInThisRealmEmptyStateMessageExist(false)
|
|
|
|
.createGroup(groupName, false)
|
|
|
|
.assertNotificationGroupCreated()
|
2022-09-15 18:12:20 +00:00
|
|
|
.searchGroup(groupName, true)
|
2022-06-27 08:47:41 +00:00
|
|
|
.assertGroupItemExist(groupName, true);
|
|
|
|
});
|
2021-03-01 15:06:04 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Fail to create group with empty name", () => {
|
|
|
|
groupPage
|
|
|
|
.assertNoGroupsInThisRealmEmptyStateMessageExist(false)
|
|
|
|
.createGroup(" ", false)
|
|
|
|
.assertNotificationCouldNotCreateGroupWithEmptyName();
|
|
|
|
groupModal.closeModal();
|
|
|
|
});
|
2021-03-01 15:06:04 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Fail to create group with duplicated name", () => {
|
|
|
|
groupPage
|
|
|
|
.assertNoGroupsInThisRealmEmptyStateMessageExist(false)
|
|
|
|
.createGroup(groupName, false)
|
|
|
|
.createGroup(groupName, false)
|
|
|
|
.assertNotificationCouldNotCreateGroupWithDuplicatedName(groupName);
|
|
|
|
groupModal.closeModal();
|
|
|
|
groupPage.searchGroup(groupName).assertGroupItemsEqual(1);
|
|
|
|
});
|
2021-03-01 15:06:04 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Empty search", () => {
|
|
|
|
groupPage.searchGroup(" ").assertNoSearchResultsMessageExist(true);
|
|
|
|
});
|
2021-03-01 15:06:04 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Search group that exists", () => {
|
|
|
|
groupPage
|
|
|
|
.searchGroup(groupNames[0])
|
|
|
|
.assertGroupItemExist(groupNames[0], true);
|
2021-03-01 15:06:04 +00:00
|
|
|
});
|
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Search group that does not exists", () => {
|
|
|
|
groupPage
|
|
|
|
.searchGroup("not-existent-group")
|
|
|
|
.assertNoSearchResultsMessageExist(true);
|
|
|
|
});
|
2021-03-24 14:07:49 +00:00
|
|
|
|
2024-10-23 18:38:25 +00:00
|
|
|
it("Duplicate group", () => {
|
2024-09-27 11:25:09 +00:00
|
|
|
groupPage
|
|
|
|
.duplicateGroupItem(groupNames[0], true)
|
|
|
|
.assertNotificationGroupDuplicated();
|
|
|
|
});
|
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Delete group from item bar", () => {
|
|
|
|
groupPage
|
2022-09-15 18:12:20 +00:00
|
|
|
.searchGroup(groupNames[0], true)
|
2022-06-27 08:47:41 +00:00
|
|
|
.deleteGroupItem(groupNames[0])
|
|
|
|
.assertNotificationGroupDeleted()
|
2022-10-10 15:03:27 +00:00
|
|
|
.searchGroup(groupNames[0], true)
|
2022-06-27 08:47:41 +00:00
|
|
|
.assertNoSearchResultsMessageExist(true);
|
|
|
|
});
|
2021-03-24 14:07:49 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Delete group from search bar", () => {
|
|
|
|
groupPage
|
|
|
|
.selectGroupItemCheckbox([groupNames[1]])
|
|
|
|
.deleteSelectedGroups()
|
|
|
|
.assertNotificationGroupDeleted()
|
|
|
|
.searchGroup(groupNames[1])
|
|
|
|
.assertNoSearchResultsMessageExist(true);
|
2021-03-24 14:07:49 +00:00
|
|
|
});
|
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Delete groups from search bar", () => {
|
|
|
|
cy.wrap(null).then(() =>
|
2023-07-11 14:03:21 +00:00
|
|
|
adminClient.createGroup("group_multiple_deletion_test"),
|
2022-06-27 08:47:41 +00:00
|
|
|
);
|
|
|
|
cy.reload();
|
|
|
|
groupPage
|
|
|
|
.selectGroupItemCheckboxAllRows()
|
|
|
|
.deleteSelectedGroups()
|
|
|
|
.assertNotificationGroupsDeleted()
|
|
|
|
.assertNoGroupsInThisRealmEmptyStateMessageExist(true);
|
|
|
|
});
|
|
|
|
});
|
2021-03-29 11:37:47 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
describe("Search group under current group", () => {
|
|
|
|
before(async () => {
|
|
|
|
const createdGroups = await adminClient.createSubGroups(predefinedGroups);
|
|
|
|
await Promise.all([
|
|
|
|
range(5).map((index) => {
|
|
|
|
adminClient.addUserToGroup(
|
|
|
|
users[index].id!,
|
2023-07-11 14:03:21 +00:00
|
|
|
createdGroups[index % 3].id,
|
2022-06-27 08:47:41 +00:00
|
|
|
);
|
|
|
|
}),
|
|
|
|
]);
|
|
|
|
});
|
2021-09-26 10:41:42 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Search child group in group", () => {
|
|
|
|
groupPage
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[0])
|
|
|
|
.searchGroup(predefinedGroups[1])
|
2022-09-15 18:12:20 +00:00
|
|
|
.assertGroupItemExist(predefinedGroups[1], true);
|
2022-06-27 08:47:41 +00:00
|
|
|
});
|
2021-03-29 11:37:47 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Search non existing child group in group", () => {
|
|
|
|
groupPage
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[0])
|
|
|
|
.searchGroup("non-existent-sub-group")
|
|
|
|
.assertNoSearchResultsMessageExist(true);
|
2021-03-29 11:37:47 +00:00
|
|
|
});
|
2021-04-07 17:58:29 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Empty search in group", () => {
|
|
|
|
groupPage
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[0])
|
|
|
|
.searchGroup(" ")
|
|
|
|
.assertNoSearchResultsMessageExist(true);
|
|
|
|
});
|
|
|
|
});
|
2021-04-07 17:58:29 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
describe("Group Actions", () => {
|
|
|
|
const groupNameDeleteHeaderAction = "group_test_delete_header_action";
|
2021-04-07 17:58:29 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
before(async () => {
|
|
|
|
await adminClient.createGroup(groupNameDeleteHeaderAction);
|
|
|
|
});
|
2022-05-12 13:46:10 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
after(async () => {
|
|
|
|
await adminClient.deleteGroups();
|
|
|
|
});
|
2022-05-12 13:46:10 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
describe("Search globally", () => {
|
|
|
|
it("Navigate to parent group details", () => {
|
|
|
|
searchGroupPage
|
|
|
|
.searchGroup(predefinedGroups[0])
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[0])
|
|
|
|
.assertGroupItemExist(predefinedGroups[1], true);
|
|
|
|
});
|
2021-05-06 05:31:40 +00:00
|
|
|
});
|
2021-05-18 12:25:46 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Rename group", () => {
|
|
|
|
groupPage.goToGroupChildGroupsTab(predefinedGroups[0]);
|
|
|
|
groupDetailPage
|
|
|
|
.renameGroup("new_group_name")
|
|
|
|
.assertNotificationGroupUpdated()
|
|
|
|
.assertHeaderGroupNameEqual("new_group_name")
|
|
|
|
.renameGroup(predefinedGroups[0])
|
|
|
|
.assertNotificationGroupUpdated()
|
|
|
|
.assertHeaderGroupNameEqual(predefinedGroups[0]);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Delete group from group details", () => {
|
|
|
|
groupPage.goToGroupChildGroupsTab(groupNameDeleteHeaderAction);
|
|
|
|
groupDetailPage
|
|
|
|
.headerActionDeleteGroup()
|
|
|
|
.assertNotificationGroupDeleted()
|
|
|
|
.assertGroupItemExist(groupNameDeleteHeaderAction, false);
|
2021-04-07 17:58:29 +00:00
|
|
|
});
|
2021-03-01 15:06:04 +00:00
|
|
|
});
|
2021-03-16 12:37:57 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
describe("Child Groups", () => {
|
|
|
|
before(async () => {
|
|
|
|
await adminClient.createGroup(predefinedGroups[0]);
|
|
|
|
});
|
|
|
|
|
|
|
|
after(async () => {
|
|
|
|
await adminClient.deleteGroups();
|
|
|
|
});
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
groupPage.goToGroupChildGroupsTab(predefinedGroups[0]);
|
|
|
|
});
|
2021-03-16 12:37:57 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Check empty state", () => {
|
|
|
|
childGroupsTab.assertNoGroupsInThisSubGroupEmptyStateMessageExist(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Create group from empty state", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.createGroup(predefinedGroups[1], true)
|
|
|
|
.assertNotificationGroupCreated();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Create group from search bar", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.createGroup(predefinedGroups[2], false)
|
|
|
|
.assertNotificationGroupCreated();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Fail to create group with empty name", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.createGroup(" ", false)
|
|
|
|
.assertNotificationCouldNotCreateGroupWithEmptyName();
|
|
|
|
});
|
|
|
|
|
|
|
|
// https://github.com/keycloak/keycloak-admin-ui/issues/2726
|
|
|
|
it.skip("Fail to create group with duplicated name", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.createGroup(predefinedGroups[2], false)
|
|
|
|
.assertNotificationCouldNotCreateGroupWithDuplicatedName(
|
2023-07-11 14:03:21 +00:00
|
|
|
predefinedGroups[2],
|
2022-06-27 08:47:41 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Move group from item bar", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.moveGroupItemAction(predefinedGroups[1], [
|
|
|
|
predefinedGroups[0],
|
|
|
|
predefinedGroups[2],
|
|
|
|
])
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[2])
|
|
|
|
.assertGroupItemExist(predefinedGroups[1], true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Search group", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.searchGroup(predefinedGroups[2])
|
|
|
|
.assertGroupItemExist(predefinedGroups[2], true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Show child group in groups", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[2])
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[1])
|
|
|
|
.assertNoGroupsInThisSubGroupEmptyStateMessageExist(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Delete group from search bar", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[2])
|
|
|
|
.selectGroupItemCheckbox([predefinedGroups[1]])
|
|
|
|
.deleteSelectedGroups()
|
|
|
|
.assertNotificationGroupDeleted();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Delete group from item bar", () => {
|
|
|
|
childGroupsTab
|
|
|
|
.deleteGroupItem(predefinedGroups[2])
|
|
|
|
.assertNotificationGroupDeleted()
|
|
|
|
.assertNoGroupsInThisSubGroupEmptyStateMessageExist(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("Members", () => {
|
2021-03-16 12:37:57 +00:00
|
|
|
before(async () => {
|
2022-06-27 08:47:41 +00:00
|
|
|
const createdGroups = await adminClient.createSubGroups(predefinedGroups);
|
|
|
|
await Promise.all([
|
|
|
|
range(5).map((index) => {
|
|
|
|
adminClient.addUserToGroup(
|
|
|
|
users[index].id!,
|
2023-07-11 14:03:21 +00:00
|
|
|
createdGroups[index % 3].id,
|
2022-06-27 08:47:41 +00:00
|
|
|
);
|
|
|
|
}),
|
|
|
|
adminClient.createGroup(emptyGroup),
|
2024-05-30 11:46:21 +00:00
|
|
|
adminClient.createUser({ username: "new", enabled: true }),
|
2022-06-27 08:47:41 +00:00
|
|
|
]);
|
2021-03-16 12:37:57 +00:00
|
|
|
});
|
|
|
|
|
2024-05-30 11:46:21 +00:00
|
|
|
after(() => adminClient.deleteUser("new"));
|
|
|
|
|
2021-03-16 12:37:57 +00:00
|
|
|
beforeEach(() => {
|
2022-06-27 08:47:41 +00:00
|
|
|
groupPage.goToGroupChildGroupsTab(predefinedGroups[0]);
|
|
|
|
childGroupsTab.goToMembersTab();
|
2021-03-16 12:37:57 +00:00
|
|
|
});
|
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Add member from search bar", () => {
|
|
|
|
membersTab
|
|
|
|
.addMember(["new"], false)
|
|
|
|
.assertNotificationUserAddedToTheGroup(1);
|
2021-03-16 12:37:57 +00:00
|
|
|
});
|
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Show members with sub-group users", () => {
|
|
|
|
membersTab
|
|
|
|
.assertUserItemExist(users[0].username, true)
|
|
|
|
.assertUserItemExist("new", true)
|
|
|
|
.assertUserItemExist(users[3].username, true)
|
|
|
|
.clickCheckboxIncludeSubGroupUsers()
|
|
|
|
.assertUserItemExist("new", true)
|
|
|
|
.assertUserItemExist(users[0].username, true)
|
|
|
|
.assertUserItemExist(users[1].username, true)
|
|
|
|
.assertUserItemExist(users[2].username, true)
|
|
|
|
.assertUserItemExist(users[3].username, true)
|
|
|
|
.assertUserItemExist(users[4].username, true)
|
|
|
|
.goToChildGroupsTab()
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[1])
|
|
|
|
.goToMembersTab()
|
|
|
|
.assertUserItemExist(users[1].username, true)
|
|
|
|
.assertUserItemExist(users[4].username, true)
|
|
|
|
.goToChildGroupsTab()
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[2])
|
|
|
|
.goToMembersTab()
|
|
|
|
.assertUserItemExist(users[2].username, true);
|
|
|
|
});
|
2021-03-16 12:37:57 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Add member from empty state", () => {
|
|
|
|
sidebarPage.goToGroups();
|
|
|
|
groupPage.goToGroupChildGroupsTab(emptyGroup);
|
|
|
|
childGroupsTab.goToMembersTab();
|
|
|
|
membersTab
|
|
|
|
.addMember([users[0].username, users[1].username], true)
|
|
|
|
.assertNotificationUserAddedToTheGroup(2);
|
|
|
|
});
|
2021-03-16 12:37:57 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Leave group from search bar", () => {
|
|
|
|
sidebarPage.goToGroups();
|
|
|
|
groupPage.goToGroupChildGroupsTab(emptyGroup);
|
|
|
|
childGroupsTab.goToMembersTab();
|
|
|
|
membersTab
|
|
|
|
.selectUserItemCheckbox([users[0].username])
|
|
|
|
.leaveGroupSelectedUsers()
|
|
|
|
.assertNotificationUserLeftTheGroup(1)
|
|
|
|
.assertUserItemExist(users[0].username, false);
|
2021-03-16 12:37:57 +00:00
|
|
|
});
|
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Leave group from item bar", () => {
|
|
|
|
sidebarPage.goToGroups();
|
|
|
|
groupPage.goToGroupChildGroupsTab(emptyGroup);
|
|
|
|
childGroupsTab.goToMembersTab();
|
|
|
|
membersTab
|
|
|
|
.leaveGroupUserItem(users[1].username)
|
|
|
|
.assertNotificationUserLeftTheGroup(1)
|
|
|
|
.assertNoUsersFoundEmptyStateMessageExist(true);
|
2021-03-16 12:37:57 +00:00
|
|
|
});
|
2024-10-29 12:27:09 +00:00
|
|
|
|
|
|
|
it("Show memberships from item bar", () => {
|
|
|
|
sidebarPage.goToGroups();
|
|
|
|
groupPage.goToGroupChildGroupsTab(predefinedGroups[0]);
|
|
|
|
childGroupsTab.goToMembersTab();
|
|
|
|
membersTab
|
|
|
|
.showGroupMembershipsItem(users[3].username)
|
|
|
|
.assertGroupItemExist(predefinedGroups[0], true)
|
|
|
|
.cancelShowGroupMembershipsModal();
|
|
|
|
});
|
2022-06-27 08:47:41 +00:00
|
|
|
});
|
2021-03-16 12:37:57 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
describe("Breadcrumbs", () => {
|
|
|
|
it("Navigate to parent group", () => {
|
|
|
|
groupPage
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[0])
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[1])
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[2])
|
|
|
|
.goToGroupChildGroupsTab(predefinedGroups[3]);
|
|
|
|
cy.reload();
|
|
|
|
groupPage.clickBreadcrumbItem(predefinedGroups[2]);
|
|
|
|
groupDetailPage.assertHeaderGroupNameEqual(predefinedGroups[2]);
|
|
|
|
groupPage.clickBreadcrumbItem(predefinedGroups[1]);
|
|
|
|
groupDetailPage.assertHeaderGroupNameEqual(predefinedGroups[1]);
|
|
|
|
groupPage.clickBreadcrumbItem(predefinedGroups[0]);
|
|
|
|
groupDetailPage.assertHeaderGroupNameEqual(predefinedGroups[0]);
|
|
|
|
groupPage
|
|
|
|
.clickBreadcrumbItem("Groups")
|
|
|
|
.assertGroupItemExist(predefinedGroups[0], true);
|
|
|
|
});
|
|
|
|
});
|
2021-03-24 14:07:49 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
describe("Attributes", () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
groupPage.goToGroupChildGroupsTab(predefinedGroups[0]);
|
|
|
|
groupDetailPage.goToAttributesTab();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Add attribute", () => {
|
|
|
|
attributesTab.addAttribute("key", "value").save();
|
|
|
|
groupPage.assertNotificationGroupUpdated();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Remove attribute", () => {
|
2023-04-04 08:09:31 +00:00
|
|
|
attributesTab.deleteAttribute(0);
|
|
|
|
attributesTab.assertEmpty();
|
2022-06-27 08:47:41 +00:00
|
|
|
groupPage.assertNotificationGroupUpdated();
|
2021-03-24 14:07:49 +00:00
|
|
|
});
|
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
it("Revert changes", () => {
|
2021-10-25 14:38:54 +00:00
|
|
|
attributesTab
|
2022-06-27 08:47:41 +00:00
|
|
|
.addAttribute("key", "value")
|
|
|
|
.addAnAttributeButton()
|
|
|
|
.revert()
|
2023-04-04 08:09:31 +00:00
|
|
|
.assertEmpty();
|
2022-06-27 08:47:41 +00:00
|
|
|
});
|
|
|
|
});
|
2021-03-16 12:37:57 +00:00
|
|
|
|
2022-06-27 08:47:41 +00:00
|
|
|
describe("'Move to' function", () => {
|
|
|
|
it("Move group to other group", () => {
|
|
|
|
groupPage
|
|
|
|
.moveGroupItemAction(predefinedGroups[0], [emptyGroup])
|
|
|
|
.goToGroupChildGroupsTab(emptyGroup)
|
|
|
|
.assertGroupItemExist(predefinedGroups[0], true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Move group to root", () => {
|
|
|
|
groupPage
|
|
|
|
.goToGroupChildGroupsTab(emptyGroup)
|
|
|
|
.moveGroupItemAction(predefinedGroups[0], ["root"]);
|
|
|
|
sidebarPage.goToGroups();
|
|
|
|
groupPage.assertGroupItemExist(predefinedGroups[0], true);
|
2021-03-16 12:37:57 +00:00
|
|
|
});
|
|
|
|
});
|
2022-09-05 21:30:25 +00:00
|
|
|
|
2022-09-14 10:44:30 +00:00
|
|
|
describe("Role mappings", () => {
|
|
|
|
const roleMappingTab = new RoleMappingTab("group");
|
2024-02-19 01:09:22 +00:00
|
|
|
|
2022-09-14 10:44:30 +00:00
|
|
|
beforeEach(() => {
|
|
|
|
groupPage.goToGroupChildGroupsTab(predefinedGroups[0]);
|
|
|
|
groupDetailPage.goToRoleMappingTab();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check empty state", () => {
|
|
|
|
commonPage.emptyState().checkIfExists(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Assign roles from empty state", () => {
|
|
|
|
roleMappingTab.assignRole();
|
2024-05-13 07:46:07 +00:00
|
|
|
roleMappingTab
|
|
|
|
.changeRoleTypeFilter("roles")
|
|
|
|
.selectRow("default-roles-")
|
|
|
|
.assign();
|
2022-09-14 10:44:30 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Show and search roles", () => {
|
2022-10-10 15:03:27 +00:00
|
|
|
groupDetailPage.checkDefaultRole();
|
2022-09-14 10:44:30 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Check hide inherited roles option", () => {
|
|
|
|
roleMappingTab.unhideInheritedRoles();
|
|
|
|
roleMappingTab.hideInheritedRoles();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Remove roles", () => {
|
2022-10-10 15:03:27 +00:00
|
|
|
roleMappingTab.selectRow("default-roles");
|
2022-09-14 10:44:30 +00:00
|
|
|
roleMappingTab.unAssign();
|
|
|
|
groupDetailPage.deleteRole();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2022-09-05 21:30:25 +00:00
|
|
|
describe("Permissions", () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
groupPage.goToGroupChildGroupsTab(predefinedGroups[0]);
|
|
|
|
groupDetailPage.goToPermissionsTab();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("enable/disable permissions", () => {
|
|
|
|
groupDetailPage.enablePermissionSwitch();
|
|
|
|
});
|
|
|
|
});
|
2023-03-22 16:14:53 +00:00
|
|
|
|
|
|
|
describe("Accessibility tests for groups", () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
loginPage.logIn();
|
|
|
|
keycloakBefore();
|
|
|
|
sidebarPage.goToGroups();
|
|
|
|
cy.injectAxe();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check a11y violations on load/ groups", () => {
|
|
|
|
cy.checkA11y();
|
|
|
|
});
|
|
|
|
});
|
2021-03-01 15:06:04 +00:00
|
|
|
});
|