diff --git a/tests/e2e/cucumber/environment/index.ts b/tests/e2e/cucumber/environment/index.ts index ecdbe99b88e..f2efcd51019 100644 --- a/tests/e2e/cucumber/environment/index.ts +++ b/tests/e2e/cucumber/environment/index.ts @@ -109,8 +109,8 @@ After(async function (this: World, { result }: ITestCaseHookParameter) { } await cleanUpSpaces(this.usersEnvironment.getUser({ key: 'admin' })) + await cleanUpGroup(this.usersEnvironment.getUser({ key: 'admin' })) - createdGroupStore.clear() createdLinkStore.clear() }) @@ -140,3 +140,17 @@ const cleanUpSpaces = async (adminUser: User) => { await Promise.all(requests) createdSpaceStore.clear() } + +const cleanUpGroup = async (adminUser: User) => { + const requests = [] + createdGroupStore.forEach((group) => { + if (config.ocis) { + requests.push(api.graph.deleteGroup({ group, admin: adminUser })) + } else { + requests.push(api.user.deleteGroup({ group, admin: adminUser })) + } + }) + + await Promise.all(requests) + createdGroupStore.clear() +} diff --git a/tests/e2e/cucumber/steps/api.ts b/tests/e2e/cucumber/steps/api.ts index 0e58677dd53..f578fd78392 100644 --- a/tests/e2e/cucumber/steps/api.ts +++ b/tests/e2e/cucumber/steps/api.ts @@ -69,10 +69,8 @@ Given( for (const info of stepTable.hashes()) { const group = this.usersEnvironment.getGroup({ key: info.id }) if (config.ocis) { - await api.graph.deleteGroup({ group, admin }) await api.graph.createGroup({ group, admin }) } else { - await api.user.deleteGroup({ group, admin }) await api.user.createGroup({ group, admin }) } } diff --git a/tests/e2e/cucumber/steps/ui/adminSettings.ts b/tests/e2e/cucumber/steps/ui/adminSettings.ts index 7abd6b3f542..9dee0970ad5 100644 --- a/tests/e2e/cucumber/steps/ui/adminSettings.ts +++ b/tests/e2e/cucumber/steps/ui/adminSettings.ts @@ -404,14 +404,6 @@ When( const { page } = this.actorsEnvironment.getActor({ key: stepUser }) const groupsObject = new objects.applicationAdminSettings.Groups({ page }) - for (const info of stepTable.hashes()) { - const group = this.usersEnvironment.getGroup({ key: info.id }) - await api.graph.deleteGroup({ - group: group, - admin: this.usersEnvironment.getUser({ key: stepUser }) - }) - } - await page.reload() for (const info of stepTable.hashes()) { await groupsObject.createGroup({ key: info.id }) } diff --git a/tests/e2e/support/api/graph/userManagement.ts b/tests/e2e/support/api/graph/userManagement.ts index eda28946976..3ef80eb834e 100644 --- a/tests/e2e/support/api/graph/userManagement.ts +++ b/tests/e2e/support/api/graph/userManagement.ts @@ -109,7 +109,9 @@ export const deleteGroup = async ({ group: Group admin: User }): Promise => { - const groupId = await getGroupId({ group, admin }) + const usersEnvironment = new UsersEnvironment() + const groupId = usersEnvironment.getCreatedGroup({ key: group.id }).uuid + await request({ method: 'DELETE', path: join('graph', 'v1.0', 'groups', groupId),