Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] Add e2e tests for spaces group members #8185

Merged
merged 6 commits into from
Jan 5, 2023
Merged
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
7 changes: 7 additions & 0 deletions changelog/unreleased/enhancement-share-group-recipient
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Space group shares

We've added the possibility to share a space with a group.

https://github.com/owncloud/web/pull/8161
https://github.com/owncloud/web/issues/8160
https://github.com/owncloud/web/pull/8185
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ Feature: spaces participant management

Scenario: participant management
Given "Admin" creates following users
| id |
| Alice |
| Brian |
| Carol |
| id |
| Alice |
| Brian |
| Carol |
| Marie |
| Richard |
And "Admin" creates following group
| id |
| sales |
| security |
And "Admin" adds user to the group
| user | group |
| Marie | sales |
| Richard | security |
And "Admin" assigns following roles to the users
| id | role |
| Alice | SpaceAdmin |
Expand All @@ -16,10 +26,12 @@ Feature: spaces participant management
| name | id |
| team | team.1 |
And "Alice" navigates to the project space "team.1"
And "Alice" adds following users to the project space
| user | role |
| Brian | editor |
| Carol | viewer |
And "Alice" adds following members to the project space
| member | role | kind |
| Brian | editor | user  |
| Carol | viewer | user |
| sales | viewer | group |
| security | editor | group |
When "Brian" logs in
And "Brian" navigates to the projects space page
And "Brian" navigates to the project space "team.1"
Expand All @@ -29,6 +41,21 @@ Feature: spaces participant management
And "Brian" uploads the following resources
| resource | to |
| lorem.txt | parent |
When "Marie" logs in
And "Marie" navigates to the projects space page
And "Marie" navigates to the project space "team.1"
Then "Marie" should see folder "parent" but should not be able to edit
And "Marie" logs out
When "Richard" logs in
And "Richard" navigates to the projects space page
And "Richard" navigates to the project space "team.1"
And "Richard" creates the following resources
| resource | type |
| richard | folder |
And "Richard" uploads the following resources
| resource | to |
| lorem.txt | richard |
And "Richard" logs out
When "Carol" logs in
And "Carol" navigates to the projects space page
And "Carol" navigates to the project space "team.1"
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/cucumber/features/smoke/spaces/publicLink.ocis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Feature: spaces public link
| spaceFolder | folder |
And "Alice" creates a public link for the resource "spaceFolder" using the sidebar panel
And "Alice" renames the most recently created public link of resource "spaceFolder" to "folderLink"
And "Alice" adds following users to the project space
| user | role |
| Brian | editor |
| Carol | viewer |
| Marie | manager |
And "Alice" adds following members to the project space
| member | role | kind |
| Brian | editor | user |
| Carol | viewer | user |
| Marie | manager | user |
And "Alice" logs out
When "Brian" logs in
And "Brian" navigates to the projects space page
Expand Down
14 changes: 9 additions & 5 deletions tests/e2e/cucumber/steps/ui/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,20 @@ When(
)

When(
'{string} adds following users to the project space',
'{string} adds following member(s) to the project space',
async function (this: World, stepUser: string, stepTable: DataTable): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const spacesObject = new objects.applicationFiles.Spaces({ page })
for (const { user, role } of stepTable.hashes()) {
const member = {
collaborator: this.usersEnvironment.getUser({ key: user }),
for (const { member, role, kind } of stepTable.hashes()) {
const collaborator =
kind === 'user'
? this.usersEnvironment.getUser({ key: member })
: this.usersEnvironment.getGroup({ key: member })
const collaboratorWithRole = {
collaborator,
role
}
await spacesObject.addMembers({ users: [member] })
await spacesObject.addMembers({ users: [collaboratorWithRole] })
}
}
)
Expand Down
9 changes: 9 additions & 0 deletions tests/e2e/support/store/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,14 @@ export const userStore = new Map<string, User>([
password: '1234',
email: 'marie@example.org'
}
],
[
'richard',
{
id: 'richard',
displayName: 'Richard Phillips Feynman',
password: '1234',
email: 'richard@example.org'
}
]
])