diff --git a/.drone.star b/.drone.star index 009ef0bfc53..b47124517fa 100644 --- a/.drone.star +++ b/.drone.star @@ -144,7 +144,6 @@ config = { "cucumber/features/admin-settings/users.feature:106", "cucumber/features/admin-settings/users.feature:131", "cucumber/features/admin-settings/users.feature:185", - "cucumber/features/admin-settings/spaces.feature", "cucumber/features/keycloak", ], "extraServerEnvironment": { diff --git a/tests/e2e-playwright/specs/admin-settings/spaces.spec.ts b/tests/e2e-playwright/specs/admin-settings/spaces.spec.ts new file mode 100644 index 00000000000..75f8101d043 --- /dev/null +++ b/tests/e2e-playwright/specs/admin-settings/spaces.spec.ts @@ -0,0 +1,334 @@ +import { test } from '@playwright/test' +import { config } from '../../../e2e/config.js' +import { + ActorsEnvironment, + SpacesEnvironment, + UsersEnvironment +} from '../../../e2e/support/environment' +import { createdSpaceStore } from '../../../e2e/support/store' +import { setAccessAndRefreshToken } from '../../helpers/setAccessAndRefreshToken' +import * as ui from '../../steps/ui/index' +import * as api from '../../steps/api/api' + +test.describe('spaces management', () => { + let actorsEnvironment + let spacesEnvironment + const usersEnvironment = new UsersEnvironment() + + test.beforeEach(async ({ browser }) => { + createdSpaceStore.clear() + spacesEnvironment = new SpacesEnvironment() + actorsEnvironment = new ActorsEnvironment({ + context: { + acceptDownloads: config.acceptDownloads, + reportDir: config.reportDir, + tracingReportDir: config.tracingReportDir, + reportHar: config.reportHar, + reportTracing: config.reportTracing, + reportVideo: config.reportVideo, + failOnUncaughtConsoleError: config.failOnUncaughtConsoleError + }, + browser: browser + }) + + await setAccessAndRefreshToken(usersEnvironment) + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] }) + }) + + test.afterEach(async () => { + await ui.logOutUser({ actorsEnvironment, stepUser: 'Alice' }) + await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Alice' }) + await api.userHasDeletedProjectSpace({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Admin', + id: 'team.a', + name: 'team A' + }) + }) + + test('spaces can be created', async () => { + await api.userHasAssignedRolesToUsers({ + usersEnvironment, + stepUser: 'Admin', + users: [{ id: 'Alice', role: 'Space Admin' }] + }) + await api.userHasCreatedProjectSpaces({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Alice', + spaces: [{ name: 'team A', id: 'team.a' }] + }) + await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) + await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'admin-settings' }) + await ui.userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) + await ui.userCreatesProjectSpaces({ + actorsEnvironment, + stepUser: 'Alice', + spaces: [{ name: 'team B', id: 'team.b' }] + }) + await ui.userShouldSeeSpaces({ + actorsEnvironment, + stepUser: 'Alice', + expectedSpaceIds: ['team.a', 'team.b'] + }) + await api.userHasDeletedProjectSpace({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Admin', + name: 'team B', + id: 'team.b' + }) + }) + + test('spaces can be managed in the admin settings via the context menu', async () => { + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Brian'] }) + await api.userHasAssignedRolesToUsers({ + usersEnvironment, + stepUser: 'Admin', + users: [ + { id: 'Alice', role: 'Space Admin' }, + { id: 'Brian', role: 'Space Admin' } + ] + }) + await api.userHasCreatedProjectSpaces({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Alice', + spaces: [ + { name: 'team A', id: 'team.a' }, + { name: 'team B', id: 'team.b' } + ] + }) + await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) + await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'admin-settings' }) + await ui.userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) + await ui.userUpdatesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser: 'Alice', + spaceId: 'team.a', + updates: [ + { attribute: 'name', value: 'developer team' }, + { attribute: 'subtitle', value: 'developer team-subtitle' }, + { attribute: 'quota', value: '50' } + ] + }) + await ui.userDisablesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser: 'Alice', + spaceId: 'team.a' + }) + await ui.userEnablesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser: 'Alice', + spaceId: 'team.a' + }) + await ui.userShouldSeeSpaces({ + actorsEnvironment, + stepUser: 'Alice', + expectedSpaceIds: ['team.a'] + }) + await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Brian' }) + await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Brian', name: 'admin-settings' }) + await ui.userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Brian' }) + await ui.userDisablesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser: 'Brian', + spaceId: 'team.b' + }) + await ui.userDeletesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser: 'Brian', + spaceId: 'team.b' + }) + await ui.userShouldNotSeeSpaces({ + actorsEnvironment, + stepUser: 'Brian', + expectedSpaceIds: ['team.b'] + }) + await ui.logOutUser({ actorsEnvironment, stepUser: 'Brian' }) + await api.userHasDeletedProjectSpace({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Admin', + id: 'team.b', + name: 'team B' + }) + await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Brian' }) + }) + + test('multiple spaces can be managed at once in the admin settings via the batch actions', async () => { + await api.userHasAssignedRolesToUsers({ + usersEnvironment, + stepUser: 'Admin', + users: [{ id: 'Alice', role: 'Space Admin' }] + }) + await api.userHasCreatedProjectSpaces({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Alice', + spaces: [ + { name: 'team A', id: 'team.a' }, + { name: 'team B', id: 'team.b' }, + { name: 'team C', id: 'team.c' }, + { name: 'team D', id: 'team.d' } + ] + }) + await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) + await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'admin-settings' }) + await ui.userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) + await ui.userDisablesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b', 'team.c', 'team.d'] + }) + await ui.userEnablesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b', 'team.c', 'team.d'] + }) + await ui.userChangesSpaceQuotaUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b', 'team.c', 'team.d'], + value: '50' + }) + await ui.userDisablesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b', 'team.c', 'team.d'] + }) + await ui.userDeletesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b', 'team.c', 'team.d'] + }) + await ui.userShouldNotSeeSpaces({ + actorsEnvironment, + stepUser: 'Alice', + expectedSpaceIds: ['team.a', 'team.b', 'team.c', 'team.d'] + }) + }) + + test('list members via sidebar', async () => { + await api.usersHaveBeenCreated({ + usersEnvironment, + stepUser: 'Admin', + users: ['Brian', 'Carol', 'David', 'Edith'] + }) + await api.userHasAssignedRolesToUsers({ + usersEnvironment, + stepUser: 'Admin', + users: [{ id: 'Alice', role: 'Space Admin' }] + }) + await api.userHasCreatedProjectSpaces({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Admin', + spaces: [{ name: 'team A', id: 'team.a' }] + }) + await api.userHasAddedMembersToSpace({ + usersEnvironment, + stepUser: 'Admin', + space: 'team A', + sharee: [ + { user: 'Brian', shareType: 'user', role: 'Can edit with versions and trashbin' }, + { user: 'Carol', shareType: 'user', role: 'Can view' }, + { user: 'David', shareType: 'user', role: 'Can view' }, + { user: 'Edith', shareType: 'user', role: 'Can view' } + ] + }) + await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) + await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'admin-settings' }) + await ui.userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) + await ui.listMembersOfProjectSpaceUsingSidebarPanel({ + actorsEnvironment, + stepUser: 'Alice', + space: 'team.a' + }) + await ui.shouldSeeUsersInSidebarPanelOfSpacesAdminSettings({ + actorsEnvironment, + stepUser: 'Alice', + expectedMembers: [ + { user: 'Admin', role: 'Can manage' }, + { user: 'Brian', role: 'Can edit with versions and trashbin' }, + { user: 'Carol', role: 'Can view' }, + { user: 'David', role: 'Can view' }, + { user: 'Edith', role: 'Can view' } + ] + }) + await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Brian' }) + await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Carol' }) + await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'David' }) + await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Edith' }) + }) + + test('admin user can manage the spaces created by other space admin user', async () => { + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Brian'] }) + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Carol'] }) + await api.userHasAssignedRolesToUsers({ + usersEnvironment, + stepUser: 'Admin', + users: [ + { id: 'Alice', role: 'Admin' }, + { id: 'Brian', role: 'Space Admin' }, + { id: 'Carol', role: 'Space Admin' } + ] + }) + await api.userHasCreatedProjectSpaces({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Brian', + spaces: [{ name: 'team A', id: 'team.a' }] + }) + await api.userHasCreatedProjectSpaces({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Carol', + spaces: [{ name: 'team B', id: 'team.b' }] + }) + await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) + await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'admin-settings' }) + await ui.userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) + await ui.userChangesSpaceQuotaUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b'], + value: '50' + }) + await ui.userDisablesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b'] + }) + await ui.userEnablesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b'] + }) + await ui.userDisablesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b'] + }) + await ui.userDeletesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser: 'Alice', + spaceIds: ['team.a', 'team.b'] + }) + await ui.userShouldNotSeeSpaces({ + actorsEnvironment, + stepUser: 'Alice', + expectedSpaceIds: ['team.a', 'team.b'] + }) + await api.userHasDeletedProjectSpace({ + usersEnvironment, + spacesEnvironment, + stepUser: 'Admin', + id: 'team.b', + name: 'team B' + }) + await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Brian' }) + await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Carol' }) + }) +}) diff --git a/tests/e2e-playwright/specs/app-provider/lock.spec.ts b/tests/e2e-playwright/specs/app-provider/lock.spec.ts index 51328c93a64..254e83475e1 100644 --- a/tests/e2e-playwright/specs/app-provider/lock.spec.ts +++ b/tests/e2e-playwright/specs/app-provider/lock.spec.ts @@ -28,7 +28,7 @@ test.describe('lock', { tag: '@sse' }, () => { // | Alice | // | Brian | // | Carol | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian', 'Carol'] diff --git a/tests/e2e-playwright/specs/app-provider/urlJourneys.spec.ts b/tests/e2e-playwright/specs/app-provider/urlJourneys.spec.ts index cbb783e24b4..a5a38071a15 100644 --- a/tests/e2e-playwright/specs/app-provider/urlJourneys.spec.ts +++ b/tests/e2e-playwright/specs/app-provider/urlJourneys.spec.ts @@ -30,7 +30,7 @@ test.describe('url stability for mobile and desktop client', { tag: '@predefined // Given "Admin" creates following users using API // | id | // | Alice | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/specs/file-action/download.spec.ts b/tests/e2e-playwright/specs/file-action/download.spec.ts index 80d181ba792..a448c5c7431 100644 --- a/tests/e2e-playwright/specs/file-action/download.spec.ts +++ b/tests/e2e-playwright/specs/file-action/download.spec.ts @@ -28,7 +28,7 @@ test.describe('Download', { tag: '@predefined-users' }, () => { browser: browser }) await setAccessAndRefreshToken(usersEnvironment) - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] diff --git a/tests/e2e-playwright/specs/file-action/fileViewer.spec.ts b/tests/e2e-playwright/specs/file-action/fileViewer.spec.ts index 3e8882ac870..1dec7d80ae2 100644 --- a/tests/e2e-playwright/specs/file-action/fileViewer.spec.ts +++ b/tests/e2e-playwright/specs/file-action/fileViewer.spec.ts @@ -38,7 +38,7 @@ test.describe('Different file viewers', { tag: '@predefined-users' }, () => { // Given "Admin" creates following user using API // | id | // | Alice | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/specs/file-action/groupActions.spec.ts b/tests/e2e-playwright/specs/file-action/groupActions.spec.ts index 2a41cb85439..6c1f2f914d6 100644 --- a/tests/e2e-playwright/specs/file-action/groupActions.spec.ts +++ b/tests/e2e-playwright/specs/file-action/groupActions.spec.ts @@ -32,7 +32,7 @@ test.describe('Group actions', { tag: '@predefined-users' }, () => { // | Carol | // | David | // | Edith | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian', 'Carol', 'David', 'Edith'] diff --git a/tests/e2e-playwright/specs/navigation/applicationMenu.spec.ts b/tests/e2e-playwright/specs/navigation/applicationMenu.spec.ts index 1342b2d8d8f..b56373d27cd 100644 --- a/tests/e2e-playwright/specs/navigation/applicationMenu.spec.ts +++ b/tests/e2e-playwright/specs/navigation/applicationMenu.spec.ts @@ -24,7 +24,7 @@ test.describe('Application menu', { tag: '@predefined-users' }, () => { }) await setAccessAndRefreshToken(usersEnvironment) - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/specs/navigation/breadcrumb.spec.ts b/tests/e2e-playwright/specs/navigation/breadcrumb.spec.ts index cda3a22d21a..fe751d96f0f 100644 --- a/tests/e2e-playwright/specs/navigation/breadcrumb.spec.ts +++ b/tests/e2e-playwright/specs/navigation/breadcrumb.spec.ts @@ -24,7 +24,7 @@ test.describe('Access breadcrumb', { tag: '@predefined-users' }, () => { }) await setAccessAndRefreshToken(usersEnvironment) - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/specs/navigation/pageNotFound.spec.ts b/tests/e2e-playwright/specs/navigation/pageNotFound.spec.ts index 7afbd331639..7f095b3e506 100644 --- a/tests/e2e-playwright/specs/navigation/pageNotFound.spec.ts +++ b/tests/e2e-playwright/specs/navigation/pageNotFound.spec.ts @@ -34,7 +34,7 @@ test.describe('Page not found', { tag: '@predefined-users' }, () => { // Given "Admin" creates following user using API // | id | // | Alice | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/specs/navigation/personalSpacePagination.spec.ts b/tests/e2e-playwright/specs/navigation/personalSpacePagination.spec.ts index 33a985175c4..a50d16dc49f 100644 --- a/tests/e2e-playwright/specs/navigation/personalSpacePagination.spec.ts +++ b/tests/e2e-playwright/specs/navigation/personalSpacePagination.spec.ts @@ -34,7 +34,7 @@ test.describe('Personal space pagination', { tag: '@predefined-users' }, () => { // Given "Admin" creates following user using API // | id | // | Alice | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/specs/navigation/shortcut.spec.ts b/tests/e2e-playwright/specs/navigation/shortcut.spec.ts index 623a2a2bbaf..e8097b6bca8 100644 --- a/tests/e2e-playwright/specs/navigation/shortcut.spec.ts +++ b/tests/e2e-playwright/specs/navigation/shortcut.spec.ts @@ -36,7 +36,7 @@ test.describe( // | id | // | Alice | // | Brian | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] diff --git a/tests/e2e-playwright/specs/navigation/urlJourneys.spec.ts b/tests/e2e-playwright/specs/navigation/urlJourneys.spec.ts index c5aab47d0c7..0b477e023a0 100644 --- a/tests/e2e-playwright/specs/navigation/urlJourneys.spec.ts +++ b/tests/e2e-playwright/specs/navigation/urlJourneys.spec.ts @@ -49,7 +49,7 @@ test.describe('Navigate web directly through urls', () => { // | id | // | Alice | // | Brian | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] diff --git a/tests/e2e-playwright/specs/oidc/iframeTokenRenewal.spec.ts b/tests/e2e-playwright/specs/oidc/iframeTokenRenewal.spec.ts index 44575362cf5..892d15a155b 100644 --- a/tests/e2e-playwright/specs/oidc/iframeTokenRenewal.spec.ts +++ b/tests/e2e-playwright/specs/oidc/iframeTokenRenewal.spec.ts @@ -34,7 +34,7 @@ test.describe('details', () => { // Given "Admin" creates following users using API // | id | // | Alice | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] @@ -43,11 +43,10 @@ test.describe('details', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) // And "Alice" logs in @@ -62,11 +61,10 @@ test.describe('details', () => { // And "Alice" creates the following project spaces // | name | id | // | team | team.1 | - await ui.createProjectSpace({ + await ui.userCreatesProjectSpaces({ actorsEnvironment, stepUser: 'Alice', - name: 'team', - id: 'team.1' + spaces: [{ name: 'team', id: 'team.1' }] }) // When "Alice" waits for token renewal via iframe diff --git a/tests/e2e-playwright/specs/oidc/refreshToken.spec.ts b/tests/e2e-playwright/specs/oidc/refreshToken.spec.ts index b563de1cc79..c496afec897 100644 --- a/tests/e2e-playwright/specs/oidc/refreshToken.spec.ts +++ b/tests/e2e-playwright/specs/oidc/refreshToken.spec.ts @@ -35,7 +35,7 @@ test.describe('details', () => { // Given "Admin" creates following users using API // | id | // | Alice | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] @@ -44,11 +44,10 @@ test.describe('details', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) // And "Alice" logs in @@ -63,11 +62,10 @@ test.describe('details', () => { // And "Alice" creates the following project spaces // | name | id | // | team | team.1 | - await ui.createProjectSpace({ + await ui.userCreatesProjectSpaces({ actorsEnvironment, stepUser: 'Alice', - name: 'team', - id: 'team.1' + spaces: [{ name: 'team', id: 'team.1' }] }) // When "Alice" waits for token renewal via refresh token diff --git a/tests/e2e-playwright/specs/runtime/crashPage.spec.ts b/tests/e2e-playwright/specs/runtime/crashPage.spec.ts index 90c39b6e3e0..8ae734a064f 100644 --- a/tests/e2e-playwright/specs/runtime/crashPage.spec.ts +++ b/tests/e2e-playwright/specs/runtime/crashPage.spec.ts @@ -25,7 +25,7 @@ test.describe('crash page', () => { }) await setAccessAndRefreshToken(usersEnvironment) - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/specs/search/fullTextSearch.spec.ts b/tests/e2e-playwright/specs/search/fullTextSearch.spec.ts index 53430fae590..1ba4a7dcdb5 100644 --- a/tests/e2e-playwright/specs/search/fullTextSearch.spec.ts +++ b/tests/e2e-playwright/specs/search/fullTextSearch.spec.ts @@ -36,7 +36,7 @@ test.describe('Search', () => { // | id | // | Alice | // | Brian | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] @@ -45,11 +45,10 @@ test.describe('Search', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Brian | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Brian', - role: 'Space Admin' + users: [{ id: 'Brian', role: 'Space Admin' }] }) // And "Alice" uploads the following local file into personal space using API @@ -118,12 +117,11 @@ test.describe('Search', () => { // And "Brian" creates the following project spaces using API // | name | id | // | FullTextSearch | fulltextsearch.1 | - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Brian', - name: 'FullTextSearch', - id: 'fulltextsearch.1' + spaces: [{ name: 'FullTextSearch', id: 'fulltextsearch.1' }] }) // And "Brian" creates the following folder in space "FullTextSearch" using API diff --git a/tests/e2e-playwright/specs/search/searchProjectSpace.spec.ts b/tests/e2e-playwright/specs/search/searchProjectSpace.spec.ts index d1b0c026f07..0eaadc11529 100644 --- a/tests/e2e-playwright/specs/search/searchProjectSpace.spec.ts +++ b/tests/e2e-playwright/specs/search/searchProjectSpace.spec.ts @@ -32,27 +32,25 @@ test.describe('Search in the project space', () => { await setAccessAndRefreshToken(usersEnvironment) - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] }) - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Alice', - name: 'team', - id: 'team.1' + spaces: [{ name: 'team', id: 'team.1' }] }) await ui.navigateToSpace({ actorsEnvironment, stepUser: 'Alice', space: 'team.1' }) diff --git a/tests/e2e-playwright/specs/shares/denyShareAccess.spec.ts b/tests/e2e-playwright/specs/shares/denyShareAccess.spec.ts index 9cf1dfc6928..b25655fb37c 100644 --- a/tests/e2e-playwright/specs/shares/denyShareAccess.spec.ts +++ b/tests/e2e-playwright/specs/shares/denyShareAccess.spec.ts @@ -25,7 +25,7 @@ test.describe('deny share access', () => { await setAccessAndRefreshToken(usersEnvironment) - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] diff --git a/tests/e2e-playwright/specs/shares/internalLink.spec.ts b/tests/e2e-playwright/specs/shares/internalLink.spec.ts index 703f4d12ebc..1ad77e9f1c8 100644 --- a/tests/e2e-playwright/specs/shares/internalLink.spec.ts +++ b/tests/e2e-playwright/specs/shares/internalLink.spec.ts @@ -32,7 +32,7 @@ test.describe('internal link share', () => { await setAccessAndRefreshToken(usersEnvironment) - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] diff --git a/tests/e2e-playwright/specs/shares/share.spec.ts b/tests/e2e-playwright/specs/shares/share.spec.ts index ce86ebe750c..dd8f4d15f16 100644 --- a/tests/e2e-playwright/specs/shares/share.spec.ts +++ b/tests/e2e-playwright/specs/shares/share.spec.ts @@ -34,7 +34,7 @@ test.describe('share', () => { // | id | // | Alice | // | Brian | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] diff --git a/tests/e2e-playwright/specs/smoke/upload.spec.ts b/tests/e2e-playwright/specs/smoke/upload.spec.ts index 6202d4ad99f..ba9b23c77c6 100644 --- a/tests/e2e-playwright/specs/smoke/upload.spec.ts +++ b/tests/e2e-playwright/specs/smoke/upload.spec.ts @@ -33,7 +33,7 @@ test.describe('internal link share', () => { // Given "Admin" creates following user using API // | id | // | Alice | - await api.usersHasBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] }) + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] }) // And "Alice" logs in await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) diff --git a/tests/e2e-playwright/specs/spaces/createSpaceFromSelection.spec.ts b/tests/e2e-playwright/specs/spaces/createSpaceFromSelection.spec.ts index 8c1dc637704..2b6cf5d2c55 100644 --- a/tests/e2e-playwright/specs/spaces/createSpaceFromSelection.spec.ts +++ b/tests/e2e-playwright/specs/spaces/createSpaceFromSelection.spec.ts @@ -35,7 +35,7 @@ test.describe('create Space shortcut', () => { // Given "Admin" creates following users using API // | id | // | Alice | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] @@ -43,11 +43,10 @@ test.describe('create Space shortcut', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) // And "Alice" logs in await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' }) diff --git a/tests/e2e-playwright/specs/spaces/denySpaceAccess.spec.ts b/tests/e2e-playwright/specs/spaces/denySpaceAccess.spec.ts index ffb315568b5..130e72e3011 100644 --- a/tests/e2e-playwright/specs/spaces/denySpaceAccess.spec.ts +++ b/tests/e2e-playwright/specs/spaces/denySpaceAccess.spec.ts @@ -41,7 +41,7 @@ test.describe('deny space access', () => { // | id | // | Alice | // | Brian | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] @@ -50,11 +50,10 @@ test.describe('deny space access', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) // And "Alice" logs in @@ -63,12 +62,11 @@ test.describe('deny space access', () => { // And "Alice" creates the following project space using API // | name | id | // | sales | sales | - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Alice', - name: 'sales', - id: 'sales' + spaces: [{ name: 'sales', id: 'sales' }] }) // And "Alice" creates the following folder in space "sales" using API @@ -89,9 +87,7 @@ test.describe('deny space access', () => { usersEnvironment, stepUser: 'Alice', space: 'sales', - shareType: 'user', - sharee: 'Brian', - role: 'Can edit with versions and trashbin' + sharee: [{ user: 'Brian', shareType: 'user', role: 'Can edit with versions and trashbin' }] }) // When "Alice" navigates to the project space "sales" diff --git a/tests/e2e-playwright/specs/spaces/downloadSpace.spec.ts b/tests/e2e-playwright/specs/spaces/downloadSpace.spec.ts index b8a9d80992c..95e22d067ba 100644 --- a/tests/e2e-playwright/specs/spaces/downloadSpace.spec.ts +++ b/tests/e2e-playwright/specs/spaces/downloadSpace.spec.ts @@ -42,7 +42,7 @@ test.describe('download space', () => { // | id | // | Alice | // | Brian | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] @@ -51,11 +51,10 @@ test.describe('download space', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) // Given "Alice" logs in @@ -64,12 +63,11 @@ test.describe('download space', () => { // And "Alice" creates the following project spaces using API // | name | id | // | team | team.1 | - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Alice', - name: 'team', - id: 'team.1' + spaces: [{ name: 'team', id: 'team.1' }] }) // And "Alice" creates the following folder in space "team" using API diff --git a/tests/e2e-playwright/specs/spaces/memberExpiry.spec.ts b/tests/e2e-playwright/specs/spaces/memberExpiry.spec.ts index 1dfad555c7b..a39135fee51 100644 --- a/tests/e2e-playwright/specs/spaces/memberExpiry.spec.ts +++ b/tests/e2e-playwright/specs/spaces/memberExpiry.spec.ts @@ -36,6 +36,7 @@ test.describe('spaces member expiry', () => { await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Brian' }) await api.userHasDeletedProjectSpace({ usersEnvironment, + spacesEnvironment, stepUser: 'Admin', name: 'team', id: 'team.1' @@ -47,7 +48,7 @@ test.describe('spaces member expiry', () => { // | id | // | Alice | // | Brian | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] @@ -56,11 +57,10 @@ test.describe('spaces member expiry', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) // And "Alice" logs in @@ -69,12 +69,11 @@ test.describe('spaces member expiry', () => { // And "Alice" creates the following project space using API // | name | id | // | team | team.1 | - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Alice', - name: 'team', - id: 'team.1' + spaces: [{ name: 'team', id: 'team.1' }] }) // And "Alice" navigates to the project space "team.1" diff --git a/tests/e2e-playwright/specs/spaces/pagination.spec.ts b/tests/e2e-playwright/specs/spaces/pagination.spec.ts index 144a19bc2a5..5461d1629b5 100644 --- a/tests/e2e-playwright/specs/spaces/pagination.spec.ts +++ b/tests/e2e-playwright/specs/spaces/pagination.spec.ts @@ -41,7 +41,7 @@ test.describe('check files pagination in project space', () => { // Given "Admin" creates following user using API // | id | // | Alice | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] @@ -50,11 +50,10 @@ test.describe('check files pagination in project space', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) // And "Alice" logs in @@ -63,12 +62,11 @@ test.describe('check files pagination in project space', () => { // And "Alice" creates the following project space using API // | name | id | // | Developers | dev.1 | - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Alice', - name: 'Developers', - id: 'dev.1' + spaces: [{ name: 'Developers', id: 'dev.1' }] }) // And "Alice" creates 55 folders in space "Developers" using API diff --git a/tests/e2e-playwright/specs/spaces/participantManagement.spec.ts b/tests/e2e-playwright/specs/spaces/participantManagement.spec.ts index 538bb3605b1..057a89bca4a 100644 --- a/tests/e2e-playwright/specs/spaces/participantManagement.spec.ts +++ b/tests/e2e-playwright/specs/spaces/participantManagement.spec.ts @@ -51,7 +51,7 @@ test.describe('check files pagination in project space', () => { // | Carol | // | David | // | Edith | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian', 'Carol', 'David', 'Edith'] @@ -82,11 +82,10 @@ test.describe('check files pagination in project space', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) // And "Alice" logs in @@ -95,12 +94,11 @@ test.describe('check files pagination in project space', () => { // And "Alice" creates the following project space using API // | name | id | // | team | team.1 | - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Alice', - name: 'team', - id: 'team.1' + spaces: [{ name: 'team', id: 'team.1' }] }) // And "Alice" navigates to the project space "team.1" diff --git a/tests/e2e-playwright/specs/user-settings/gdprExport.spec.ts b/tests/e2e-playwright/specs/user-settings/gdprExport.spec.ts index bee47596a3e..41ab6d1e4d0 100644 --- a/tests/e2e-playwright/specs/user-settings/gdprExport.spec.ts +++ b/tests/e2e-playwright/specs/user-settings/gdprExport.spec.ts @@ -23,7 +23,7 @@ test.describe('GDPR export', { tag: '@predefined-users' }, () => { browser: browser }) await setAccessAndRefreshToken(usersEnvironment) - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/specs/user-settings/languageChange.spec.ts b/tests/e2e-playwright/specs/user-settings/languageChange.spec.ts index eb1ef838fbc..ed887d8bdab 100644 --- a/tests/e2e-playwright/specs/user-settings/languageChange.spec.ts +++ b/tests/e2e-playwright/specs/user-settings/languageChange.spec.ts @@ -32,7 +32,7 @@ test.describe('language settings', { tag: '@predefined-users' }, () => { await setAccessAndRefreshToken(usersEnvironment) // Given "Admin" creates following users using API - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian'] diff --git a/tests/e2e-playwright/specs/user-settings/notifications.spec.ts b/tests/e2e-playwright/specs/user-settings/notifications.spec.ts index 2089ada273d..41d82ca0fb1 100644 --- a/tests/e2e-playwright/specs/user-settings/notifications.spec.ts +++ b/tests/e2e-playwright/specs/user-settings/notifications.spec.ts @@ -37,7 +37,7 @@ test.describe('Notifications', () => { // | Alice | // | Brian | // | Carol | - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice', 'Brian', 'Carol'] @@ -46,11 +46,10 @@ test.describe('Notifications', () => { // And "Admin" assigns following roles to the users using API // | id | role | // | Alice | Space Admin | - await api.userHasAssignRolesToUsers({ + await api.userHasAssignedRolesToUsers({ usersEnvironment, stepUser: 'Admin', - targetUserId: 'Alice', - role: 'Space Admin' + users: [{ id: 'Alice', role: 'Space Admin' }] }) }) @@ -63,9 +62,10 @@ test.describe('Notifications', () => { await api.deleteUser({ usersEnvironment, stepUser: 'Admin', targetUser: 'Carol' }) await api.userHasDeletedProjectSpace({ usersEnvironment, + spacesEnvironment, stepUser: 'Admin', - name: 'team', - id: 'team.1' + id: 'team.1', + name: 'team' }) }) @@ -104,12 +104,11 @@ test.describe('Notifications', () => { // And "Alice" creates the following project space using API // | name | id | // | team | team.1 | - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Alice', - name: 'team', - id: 'team.1' + spaces: [{ name: 'team', id: 'team.1' }] }) // And "Alice" logs in @@ -237,7 +236,7 @@ test.describe('Notifications', () => { await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'admin-settings' }) // And "Alice" navigates to the project spaces management page - await ui.navigateToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) + await ui.userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) // And "Alice" disables the space "team.1" using the context-menu await ui.manageSpaceUsingContexMenu({ @@ -283,12 +282,11 @@ test.describe('Notifications', () => { // And "Alice" creates the following project space using API // | name | id | // | team | team.1 | - await api.userHasCreatedProjectSpace({ + await api.userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser: 'Alice', - name: 'team', - id: 'team.1' + spaces: [{ name: 'team', id: 'team.1' }] }) // And "Brian" logs in @@ -423,7 +421,7 @@ test.describe('Notifications', () => { await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'admin-settings' }) // And "Alice" navigates to the project spaces management page - await ui.navigateToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) + await ui.userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser: 'Alice' }) // And "Alice" disables the space "team.1" using the context-menu await ui.manageSpaceUsingContexMenu({ diff --git a/tests/e2e-playwright/specs/user-settings/tiles.spec.ts b/tests/e2e-playwright/specs/user-settings/tiles.spec.ts index a237cd6fa88..73bfebaf5b6 100644 --- a/tests/e2e-playwright/specs/user-settings/tiles.spec.ts +++ b/tests/e2e-playwright/specs/user-settings/tiles.spec.ts @@ -26,7 +26,7 @@ test.describe('tiles view', { tag: '@predefined-users' }, () => { await setAccessAndRefreshToken(usersEnvironment) // Given "Admin" creates following user using API - await api.usersHasBeenCreated({ + await api.usersHaveBeenCreated({ usersEnvironment, stepUser: 'Admin', users: ['Alice'] diff --git a/tests/e2e-playwright/steps/api/api.ts b/tests/e2e-playwright/steps/api/api.ts index 97775ef45fe..2550a819101 100644 --- a/tests/e2e-playwright/steps/api/api.ts +++ b/tests/e2e-playwright/steps/api/api.ts @@ -12,7 +12,7 @@ import fs from 'fs' import { checkResponseStatus, request } from '../../../e2e/support/api/http' import { join } from 'path' -export async function usersHasBeenCreated({ +export async function usersHaveBeenCreated({ usersEnvironment, stepUser, users @@ -152,50 +152,53 @@ export async function userHasCreatedPublicLinkOfResource({ }) } -export async function userHasAssignRolesToUsers({ +export async function userHasAssignedRolesToUsers({ usersEnvironment, stepUser, - targetUserId, - role + users }: { usersEnvironment: UsersEnvironment stepUser: string - targetUserId: string - role: string -}) { + users: Array<{ id: string; role: string }> +}): Promise { const admin = usersEnvironment.getUser({ key: stepUser }) - const user = usersEnvironment.getUser({ key: targetUserId }) - /** - The oCIS API request for assigning roles allows only one role per user, - whereas the Keycloak API request can assign multiple roles to a user. - If multiple roles are assigned to a user in Keycloak, - oCIS map the highest priority role among Keycloak assigned roles. - Therefore, we need to unassign the previous role before - assigning a new one when using the Keycloak API. - */ - await api.provision.unAssignRole({ admin, user }) - await api.provision.assignRole({ admin, user, role }) + for (const userInfo of users) { + const user = usersEnvironment.getUser({ key: userInfo.id }) + /** + The oCIS API request for assigning roles allows only one role per user, + whereas the Keycloak API request can assign multiple roles to a user. + If multiple roles are assigned to a user in Keycloak, + oCIS map the highest priority role among Keycloak assigned roles. + Therefore, we need to unassign the previous role before + assigning a new one when using the Keycloak API. + */ + await api.provision.unAssignRole({ admin, user }) + await api.provision.assignRole({ admin, user, role: userInfo.role }) + } } -export async function userHasCreatedProjectSpace({ +export async function userHasCreatedProjectSpaces({ usersEnvironment, spacesEnvironment, stepUser, - name, - id + spaces }: { usersEnvironment: UsersEnvironment spacesEnvironment: SpacesEnvironment stepUser: string - name: string - id: string + spaces: Array<{ name: string; id: string }> }) { const user = usersEnvironment.getUser({ key: stepUser }) - const spaceId = await api.graph.createSpace({ user, space: { id, name } as unknown as Space }) - spacesEnvironment.createSpace({ - key: id || name, - space: { name: name, id: spaceId } - }) + for (const space of spaces) { + const spaceId = await api.graph.createSpace({ + user, + space: { id: space.id, name: space.name } as unknown as Space + }) + spacesEnvironment.createSpace({ + key: space.id || space.name, + space: { name: space.name, id: spaceId } as unknown as Space + }) + } } export async function userHasUploadedFilesInPersonalSpace({ @@ -294,11 +297,13 @@ export async function userHasDeletedGroup({ } export async function userHasDeletedProjectSpace({ usersEnvironment, + spacesEnvironment, stepUser, name, id }: { usersEnvironment: UsersEnvironment + spacesEnvironment: SpacesEnvironment stepUser: string name: string id: string @@ -312,25 +317,23 @@ export async function userHasAddedMembersToSpace({ usersEnvironment, stepUser, space, - shareType, - role, sharee }: { usersEnvironment: UsersEnvironment stepUser: string space: string - shareType: string - role: string - sharee: string + sharee: Array<{ user: string; shareType: string; role: string }> }) { const user = usersEnvironment.getUser({ key: stepUser }) - await api.share.addMembersToTheProjectSpace({ - user, - spaceName: space, - shareType: shareType, - shareWith: sharee, - role: role - }) + for (const share of sharee) { + await api.share.addMembersToTheProjectSpace({ + user, + spaceName: space, + shareType: share.shareType, + shareWith: share.user, + role: share.role + }) + } } export const groupsHaveBeenCreated = async ({ diff --git a/tests/e2e-playwright/steps/ui/spaces.ts b/tests/e2e-playwright/steps/ui/spaces.ts index ab7b26e68d0..2cc370522f7 100644 --- a/tests/e2e-playwright/steps/ui/spaces.ts +++ b/tests/e2e-playwright/steps/ui/spaces.ts @@ -1,7 +1,11 @@ import { ActorsEnvironment, UsersEnvironment } from '../../../e2e/support/environment' import { objects } from '../../../e2e/support' import { Space } from '../../../e2e/support/types' -import { getDynamicRoleIdByName, ResourceType } from '../../../e2e/support/api/share/share' +import { + getDynamicRoleIdByName, + ResourceType, + shareRoles +} from '../../../e2e/support/api/share/share' import { expect } from '@playwright/test' export async function navigateToPersonalSpacePage({ @@ -44,20 +48,23 @@ export async function navigateToSpace({ await spacesObject.open({ key: space }) } -export async function createProjectSpace({ +export async function userCreatesProjectSpaces({ actorsEnvironment, stepUser, - name, - id + spaces }: { actorsEnvironment: ActorsEnvironment stepUser: string - name: string - id: string + spaces: Array<{ name: string; id: string }> }): Promise { const { page } = actorsEnvironment.getActor({ key: stepUser }) const spacesObject = new objects.applicationFiles.Spaces({ page }) - await spacesObject.create({ key: id || name, space: { name: name, id: id } as unknown as Space }) + for (const space of spaces) { + await spacesObject.create({ + key: space.id || space.name, + space: { name: space.name, id: space.id } as unknown as Space + }) + } } export async function userAddsMembersToSpace({ actorsEnvironment, @@ -146,7 +153,7 @@ export async function removeAccessToMember({ await spacesObject.removeAccessToMember({ users: [member] }) } -export async function navigateToProjectSpaceManagementPage({ +export async function userNavigatesToProjectSpaceManagementPage({ actorsEnvironment, stepUser }: { @@ -218,21 +225,6 @@ export async function navigateToTrashbin({ } } -export async function userShouldSeeSpace({ - actorsEnvironment, - stepUser, - space -}: { - actorsEnvironment: ActorsEnvironment - stepUser: string - space?: string -}): Promise { - const { page } = actorsEnvironment.getActor({ key: stepUser }) - const spacesObject = new objects.applicationFiles.Spaces({ page }) - const spaceLocator = await spacesObject.getSpaceLocator(space) - await expect(spaceLocator).toBeVisible() -} - export async function userShouldNotSeeSpace({ actorsEnvironment, stepUser, @@ -272,3 +264,235 @@ export async function userChangesMemberRole({ } await spacesObject.changeRoles({ users: [member] }) } + +export async function userShouldSeeSpaces({ + actorsEnvironment, + stepUser, + expectedSpaceIds +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + expectedSpaceIds: string[] +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const actualList = await spacesObject.getDisplayedSpaces() + for (const expectedSpaceId of expectedSpaceIds) { + const space = spacesObject.getSpace({ key: expectedSpaceId }) + expect(actualList).toContain(space.id) + } +} + +export async function userShouldNotSeeSpaces({ + actorsEnvironment, + stepUser, + expectedSpaceIds +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + expectedSpaceIds: string[] +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const actualList = await spacesObject.getDisplayedSpaces() + for (const expectedSpaceId of expectedSpaceIds) { + const space = spacesObject.getSpace({ key: expectedSpaceId }) + expect(actualList).not.toContain(space.id) + } +} + +export async function userDisablesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser, + spaceId +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + spaceId: string +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const spaceUUID = spacesObject.getUUID({ key: spaceId }) + await spacesObject.disable({ spaceIds: [spaceUUID], context: 'context-menu' }) +} + +export async function userEnablesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser, + spaceId +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + spaceId: string +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const spaceUUID = spacesObject.getUUID({ key: spaceId }) + await spacesObject.enable({ spaceIds: [spaceUUID], context: 'context-menu' }) +} + +export async function userDeletesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser, + spaceId +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + spaceId: string +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const spaceUUID = spacesObject.getUUID({ key: spaceId }) + await spacesObject.delete({ spaceIds: [spaceUUID], context: 'context-menu' }) +} + +export async function userDisablesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser, + spaceIds +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + spaceIds: string[] +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const uuids = spaceIds.map((id) => spacesObject.getUUID({ key: id })) + for (const id of spaceIds) { + await spacesObject.select({ key: id }) + } + await spacesObject.disable({ spaceIds: uuids, context: 'batch-actions' }) +} + +export async function userEnablesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser, + spaceIds +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + spaceIds: string[] +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const uuids = spaceIds.map((id) => spacesObject.getUUID({ key: id })) + for (const id of spaceIds) { + await spacesObject.select({ key: id }) + } + await spacesObject.enable({ spaceIds: uuids, context: 'batch-actions' }) +} + +export async function userDeletesSpacesUsingBatchActions({ + actorsEnvironment, + stepUser, + spaceIds +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + spaceIds: string[] +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const uuids = spaceIds.map((id) => spacesObject.getUUID({ key: id })) + for (const id of spaceIds) { + await spacesObject.select({ key: id }) + } + await spacesObject.delete({ spaceIds: uuids, context: 'batch-actions' }) +} + +export async function userUpdatesSpaceUsingContextMenu({ + actorsEnvironment, + stepUser, + spaceId, + updates +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + spaceId: string + updates: Array<{ attribute: 'name' | 'subtitle' | 'quota'; value: string }> +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const spaceUUID = spacesObject.getUUID({ key: spaceId }) + + for (const update of updates) { + switch (update.attribute) { + case 'name': + await spacesObject.renameSpaceUsingContextMenu({ key: spaceId, value: update.value }) + break + case 'subtitle': + await spacesObject.changeSubtitleUsingContextMenu({ key: spaceId, value: update.value }) + break + case 'quota': + await spacesObject.changeQuota({ + spaceIds: [spaceUUID], + value: update.value, + context: 'context-menu' + }) + break + default: + throw new Error(`'${update.attribute}' not implemented`) + } + } +} + +export async function userChangesSpaceQuotaUsingBatchActions({ + actorsEnvironment, + stepUser, + spaceIds, + value +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + spaceIds: string[] + value: string +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const uuids = [] + for (const spaceId of spaceIds) { + uuids.push(spacesObject.getUUID({ key: spaceId })) + await spacesObject.select({ key: spaceId }) + } + await spacesObject.changeQuota({ + spaceIds: uuids, + value, + context: 'batch-actions' + }) +} + +export async function listMembersOfProjectSpaceUsingSidebarPanel({ + actorsEnvironment, + stepUser, + space +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + space: string +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + await spacesObject.openPanel({ key: space }) + await spacesObject.openActionSideBarPanel({ action: 'SpaceMembers' }) +} +export async function shouldSeeUsersInSidebarPanelOfSpacesAdminSettings({ + actorsEnvironment, + stepUser, + expectedMembers +}: { + actorsEnvironment: ActorsEnvironment + stepUser: string + expectedMembers: Array<{ user: string; role: string }> +}): Promise { + const { page } = actorsEnvironment.getActor({ key: stepUser }) + const spacesObject = new objects.applicationAdminSettings.Spaces({ page }) + const actualMemberList = { + manager: await spacesObject.listMembers({ filter: 'Can manage' }), + viewer: await spacesObject.listMembers({ filter: 'Can view' }), + editor: await spacesObject.listMembers({ filter: 'Can edit with versions and trashbin' }) + } + for (const member of expectedMembers) { + const shareRole = shareRoles[member.role as keyof typeof shareRoles] + expect(actualMemberList[shareRole as keyof typeof actualMemberList]).toContain(member.user) + } +} diff --git a/tests/e2e/cucumber/features/admin-settings/spaces.feature b/tests/e2e/cucumber/features/admin-settings/spaces.feature deleted file mode 100644 index ee63bd5d968..00000000000 --- a/tests/e2e/cucumber/features/admin-settings/spaces.feature +++ /dev/null @@ -1,193 +0,0 @@ -Feature: spaces management - - Scenario: spaces can be created - Given "Admin" creates following users using API - | id | - | Alice | - And "Admin" assigns following roles to the users using API - | id | role | - | Alice | Space Admin | - And "Admin" creates the following project spaces using API - | name | id | - | team A | team.a | - When "Alice" logs in - And "Alice" opens the "admin-settings" app - And "Alice" navigates to the project spaces management page - And "Alice" creates the following project spaces - | name | id | - | team | team.b | - Then "Alice" should see the following spaces - | id | - | team.a | - | team.b | - And "Alice" logs out - - Scenario: spaces can be managed in the admin settings via the context menu - Given "Admin" creates following users using API - | id | - | Alice | - | Brian | - And "Admin" assigns following roles to the users using API - | id | role | - | Alice | Space Admin | - | Brian | Space Admin | - When "Alice" creates the following project spaces using API - | name | id | - | team A | team.a | - | team B | team.b | - And "Alice" logs in - When "Alice" opens the "admin-settings" app - And "Alice" navigates to the project spaces management page - When "Alice" updates the space "team.a" name to "developer team" using the context-menu - And "Alice" updates the space "team.a" subtitle to "developer team-subtitle" using the context-menu - And "Alice" updates the space "team.a" quota to "50" using the context-menu - And "Alice" disables the space "team.a" using the context-menu - And "Alice" enables the space "team.a" using the context-menu - Then "Alice" should see the following spaces - | id | - | team.a | - And "Alice" logs out - When "Brian" logs in - And "Brian" opens the "admin-settings" app - And "Brian" navigates to the project spaces management page - When "Brian" disables the space "team.b" using the context-menu - And "Brian" deletes the space "team.b" using the context-menu - Then "Brian" should not see the following spaces - | id | - | team.b | - And "Brian" logs out - - Scenario: multiple spaces can be managed at once in the admin settings via the batch actions - Given "Admin" creates following user using API - | id | - | Alice | - And "Admin" assigns following roles to the users using API - | id | role | - | Alice | Space Admin | - And "Alice" creates the following project spaces using API - | name | id | - | team A | team.a | - | team B | team.b | - | team C | team.c | - | team D | team.d | - And "Alice" logs in - When "Alice" opens the "admin-settings" app - And "Alice" navigates to the project spaces management page - And "Alice" disables the following spaces using the batch-actions - | id | - | team.a | - | team.b | - | team.c | - | team.d | - And "Alice" enables the following spaces using the batch-actions - | id | - | team.a | - | team.b | - | team.c | - | team.d | - And "Alice" updates quota of the following spaces to "50" using the batch-actions - | id | - | team.a | - | team.b | - | team.c | - | team.d | - And "Alice" disables the following spaces using the batch-actions - | id | - | team.a | - | team.b | - | team.c | - | team.d | - And "Alice" deletes the following spaces using the batch-actions - | id | - | team.a | - | team.b | - | team.c | - | team.d | - Then "Alice" should not see the following spaces - | id | - | team.a | - | team.b | - | team.c | - | team.d | - And "Alice" logs out - - - Scenario: list members via sidebar - Given "Admin" creates following users using API - | id | - | Alice | - | Brian | - | Carol | - | David | - | Edith | - And "Admin" assigns following roles to the users using API - | id | role | - | Alice | Space Admin | - And "Admin" creates the following project spaces using API - | name | id | - | team A | team.a | - And "Admin" adds the following members to the space "team A" using API - | user | role | shareType | - | Brian | Can edit with versions and trashbin | user | - | Carol | Can view | user | - | David | Can view | user | - | Edith | Can view | user | - When "Alice" logs in - And "Alice" opens the "admin-settings" app - And "Alice" navigates to the project spaces management page - When "Alice" lists the members of project space "team.a" using a sidebar panel - Then "Alice" should see the following users in the sidebar panel of spaces admin settings - | user | role | - | Admin | Can manage | - | Brian | Can edit with versions and trashbin | - | Carol | Can view | - | David | Can view | - | Edith | Can view | - And "Alice" logs out - - - Scenario: admin user can manage the spaces created by other space admin user - Given "Admin" creates following users using API - | id | - | Alice | - | Brian | - | Carol | - And "Admin" assigns following roles to the users using API - | id | role | - | Alice | Admin | - | Brian | Space Admin | - | Carol | Space Admin | - And "Brian" creates the following project spaces using API - | name | id | - | team A | team.a | - And "Carol" creates the following project spaces using API - | name | id | - | team B | team.b | - When "Alice" logs in - And "Alice" opens the "admin-settings" app - And "Alice" navigates to the project spaces management page - And "Alice" updates quota of the following spaces to "50" using the batch-actions - | id | - | team.a | - | team.b | - And "Alice" disables the following spaces using the batch-actions - | id | - | team.a | - | team.b | - And "Alice" enables the following spaces using the batch-actions - | id | - | team.a | - | team.b | - And "Alice" disables the following spaces using the batch-actions - | id | - | team.a | - | team.b | - And "Alice" deletes the following spaces using the batch-actions - | id | - | team.a | - | team.b | - Then "Alice" should not see the following spaces - | id | - | team.a | - | team.b | - And "Alice" logs out diff --git a/tests/e2e/cucumber/steps/ui/adminSettings.ts b/tests/e2e/cucumber/steps/ui/adminSettings.ts index 7bc4b836858..807b68b318e 100644 --- a/tests/e2e/cucumber/steps/ui/adminSettings.ts +++ b/tests/e2e/cucumber/steps/ui/adminSettings.ts @@ -59,10 +59,10 @@ When( const spaceId = spacesObject.getUUID({ key }) switch (attribute) { case 'name': - await spacesObject.rename({ key, value }) + await spacesObject.renameSpaceUsingContextMenu({ key, value }) break case 'subtitle': - await spacesObject.changeSubtitle({ key, value }) + await spacesObject.changeSubtitleUsingContextMenu({ key, value }) break case 'quota': await spacesObject.changeQuota({ spaceIds: [spaceId], value, context: 'context-menu' }) diff --git a/tests/e2e/support/objects/a11y/actions.ts b/tests/e2e/support/objects/a11y/actions.ts index 334efd441da..076a891279a 100644 --- a/tests/e2e/support/objects/a11y/actions.ts +++ b/tests/e2e/support/objects/a11y/actions.ts @@ -45,6 +45,7 @@ export const selectors = { // visible tippy/popover (active) tippyBoxVisible: '.tippy-box[data-state="visible"]', logoWrapper: '.logo-wrapper', + appSidebarDiv: '#app-sidebar', fileAppBar: '#files-app-bar', pageNotFound: '.page-not-found', createGroupInput: '#create-group-input-display-name', diff --git a/tests/e2e/support/objects/app-admin-settings/spaces/actions.ts b/tests/e2e/support/objects/app-admin-settings/spaces/actions.ts index f87a77cb45a..c3c83808585 100644 --- a/tests/e2e/support/objects/app-admin-settings/spaces/actions.ts +++ b/tests/e2e/support/objects/app-admin-settings/spaces/actions.ts @@ -37,7 +37,7 @@ export const getDisplayedSpaces = async (page: Page): Promise => { return spaces } -const performAction = async (args: { +const performActionUsingContextMenu = async (args: { page: Page action: string context: string @@ -47,6 +47,11 @@ const performAction = async (args: { if (id && context === 'context-menu') { await page.locator(util.format(contextMenuSelector, id)).click() + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['contextMenuContainer'], + 'context menu container' + ) } let contextMenuActionButtonSelector = `.${context} ` @@ -83,12 +88,28 @@ export const changeSpaceQuota = async (args: { context: string }): Promise => { const { page, value, spaceIds, context } = args - await performAction({ page, action: 'edit-quota', context, id: spaceIds[0] }) + await performActionUsingContextMenu({ page, action: 'edit-quota', context, id: spaceIds[0] }) + + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['ocModal'], + `change quota for space ${spaceIds[0]} modal` + ) const searchLocator = page.locator(spacesQuotaSearchField) await searchLocator.pressSequentially(value) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['ocModal'], + `change quota for space ${spaceIds[0]} modal` + ) await page.locator(selectedQuotaValueField).waitFor() await page.locator(util.format(quotaValueDropDown, `${value} GB`)).click() + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['ocModal'], + `change quota for space ${spaceIds[0]} modal after selecting quota` + ) await confirmAction({ page, method: 'PATCH', @@ -96,6 +117,11 @@ export const changeSpaceQuota = async (args: { spaceIds, actionConfirm: true }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['body'], + 'body after changing space quota' + ) } export const disableSpace = async (args: { @@ -104,7 +130,12 @@ export const disableSpace = async (args: { context: string }): Promise => { const { page, spaceIds, context } = args - await performAction({ page, action: 'disable', context, id: spaceIds[0] }) + await performActionUsingContextMenu({ page, action: 'disable', context, id: spaceIds[0] }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['ocModal'], + `disable space ${spaceIds[0]} modal` + ) await confirmAction({ page, method: 'DELETE', @@ -112,6 +143,11 @@ export const disableSpace = async (args: { spaceIds, actionConfirm: false }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['body'], + 'body after changing space quota' + ) } export const enableSpace = async (args: { @@ -120,7 +156,12 @@ export const enableSpace = async (args: { context: string }): Promise => { const { page, spaceIds, context } = args - await performAction({ page, action: 'restore', context, id: spaceIds[0] }) + await performActionUsingContextMenu({ page, action: 'restore', context, id: spaceIds[0] }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['ocModal'], + `enable space ${spaceIds[0]} modal` + ) await confirmAction({ page, method: 'PATCH', @@ -128,6 +169,11 @@ export const enableSpace = async (args: { spaceIds, actionConfirm: false }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['body'], + 'body after enabling space' + ) } export const deleteSpace = async (args: { @@ -136,7 +182,12 @@ export const deleteSpace = async (args: { context: string }): Promise => { const { page, spaceIds, context } = args - await performAction({ page, action: 'delete', context, id: spaceIds[0] }) + await performActionUsingContextMenu({ page, action: 'delete', context, id: spaceIds[0] }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['ocModal'], + `delete space ${spaceIds[0]} modal` + ) await confirmAction({ page, method: 'DELETE', @@ -144,6 +195,11 @@ export const deleteSpace = async (args: { spaceIds, actionConfirm: false }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['body'], + 'body after deleting space' + ) } export const selectSpace = async (args: { page: Page; id: string }): Promise => { @@ -154,16 +210,26 @@ export const selectSpace = async (args: { page: Page; id: string }): Promise => { const { page, id, value } = args - await performAction({ page, action: 'rename', context: 'context-menu', id }) + await performActionUsingContextMenu({ page, action: 'rename', context: 'context-menu', id }) await page.locator(inputFieldSelector).fill(value) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['ocModal'], + 'space rename modal' + ) await confirmAction({ page, method: 'PATCH', @@ -171,16 +237,31 @@ export const renameSpace = async (args: { spaceIds: [id], actionConfirm: true }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['body'], + 'body after renaming space' + ) } -export const changeSpaceSubtitle = async (args: { +export const changeSpaceSubtitleUsingContextMenu = async (args: { page: Page id: string value: string }): Promise => { const { page, id, value } = args - await performAction({ page, action: 'edit-description', context: 'context-menu', id }) + await performActionUsingContextMenu({ + page, + action: 'edit-description', + context: 'context-menu', + id + }) await page.locator(inputFieldSelector).fill(value) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['ocModal'], + `changing subtitle for space ${id} modal` + ) await confirmAction({ page, method: 'PATCH', @@ -188,6 +269,11 @@ export const changeSpaceSubtitle = async (args: { spaceIds: [id], actionConfirm: true }) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['body'], + 'body after changing space subtitle' + ) } const confirmAction = async (args: { @@ -229,6 +315,11 @@ export const openSpaceAdminSidebarPanel = async (args: { } await selectSpace({ page, id }) await page.click(toggleSidebarButton) + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['appSidebarDiv'], + 'app sidebar after opening space admin sidebar panel' + ) } export const openSpaceAdminActionSidebarPanel = async (args: { @@ -246,6 +337,11 @@ export const openSpaceAdminActionSidebarPanel = async (args: { const nextPanel = page.locator(util.format(siderBarActionPanel, action)) await panelSelector.click() await locatorUtils.waitForEvent(nextPanel, 'transitionend') + await objects.a11y.Accessibility.assertNoSevereA11yViolations( + page, + ['appSidebarDiv'], + `app sidebar after opening space admin ${action} sidebar panel` + ) } export const listSpaceMembers = async (args: { diff --git a/tests/e2e/support/objects/app-admin-settings/spaces/index.ts b/tests/e2e/support/objects/app-admin-settings/spaces/index.ts index 807f2d97ae6..4cd030fb243 100644 --- a/tests/e2e/support/objects/app-admin-settings/spaces/index.ts +++ b/tests/e2e/support/objects/app-admin-settings/spaces/index.ts @@ -52,12 +52,22 @@ export class Spaces { await po.selectSpace({ page: this.#page, id: this.getUUID({ key }) }) } - async rename({ key, value }: { key: string; value: string }): Promise { - await po.renameSpace({ page: this.#page, id: this.getUUID({ key }), value }) + async renameSpaceUsingContextMenu({ key, value }: { key: string; value: string }): Promise { + await po.renameSpaceUsingContextMenu({ page: this.#page, id: this.getUUID({ key }), value }) } - async changeSubtitle({ key, value }: { key: string; value: string }): Promise { - await po.changeSpaceSubtitle({ page: this.#page, id: this.getUUID({ key }), value }) + async changeSubtitleUsingContextMenu({ + key, + value + }: { + key: string + value: string + }): Promise { + await po.changeSpaceSubtitleUsingContextMenu({ + page: this.#page, + id: this.getUUID({ key }), + value + }) } async openPanel({ key }: { key: string }): Promise { diff --git a/tests/e2e/support/objects/app-files/spaces/actions.ts b/tests/e2e/support/objects/app-files/spaces/actions.ts index 2456139b0fb..d641c486175 100644 --- a/tests/e2e/support/objects/app-files/spaces/actions.ts +++ b/tests/e2e/support/objects/app-files/spaces/actions.ts @@ -54,6 +54,7 @@ export const createSpace = async (args: createSpaceArgs): Promise => { await page.locator(newSpaceMenuButton).click() await objects.a11y.Accessibility.assertNoSevereA11yViolations(page, ['ocModal'], 'spaces page') await page.locator(spaceNameInputField).fill(name) + await objects.a11y.Accessibility.assertNoSevereA11yViolations(page, ['ocModal'], 'spaces page') const [responses] = await Promise.all([ page.waitForResponse(