Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
334 changes: 334 additions & 0 deletions tests/e2e-playwright/specs/admin-settings/spaces.spec.ts
Original file line number Diff line number Diff line change
@@ -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' })
})
})
2 changes: 1 addition & 1 deletion tests/e2e-playwright/specs/app-provider/lock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-playwright/specs/file-action/download.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-playwright/specs/file-action/fileViewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
Loading