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

[tests-only]Add step for removing manager #7637

Merged
merged 1 commit into from
Sep 13, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ Feature: spaces participant management
When "Alice" changes the roles of the following users in the project space
| user | role |
| Carol | manager |
And "Alice" as project manager removes their own access to the project space
Then "Alice" should not be able to see space "team.1"
And "Alice" logs out
12 changes: 12 additions & 0 deletions tests/e2e/cucumber/steps/app-files/page/spaces/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,15 @@ When(
}
}
)

When(
'{string} as project manager removes their own access to the project space',
async function (this: World, stepUser: any): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const spacesObject = new objects.applicationFiles.Spaces({ page })
await spacesObject.removeAccessToMember({
users: [this.usersEnvironment.getUser({ key: stepUser })],
removeOwnSpaceAccess: true
})
}
)
6 changes: 5 additions & 1 deletion tests/e2e/support/objects/app-files/share/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,11 @@ export interface removeShareeArgs {
page: Page
folder?: string
users: User[]
removeOwnSpaceAccess?: boolean
}

export const removeSharee = async (args: removeShareeArgs): Promise<void> => {
const { page, folder, users } = args
const { page, folder, users, removeOwnSpaceAccess } = args
if (folder) {
const folderPaths = folder.split('/')
const folderName = folderPaths.pop()
Expand All @@ -209,5 +210,8 @@ export const removeSharee = async (args: removeShareeArgs): Promise<void> => {
page.locator(util.format(removeShareButton, userColumn)).click(),
page.locator(removeShareConfirmationButton).click()
])
if (removeOwnSpaceAccess) {
await page.waitForNavigation()
}
}
}
5 changes: 3 additions & 2 deletions tests/e2e/support/objects/app-files/spaces/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,13 @@ export const changeSpaceImage = async (args: {
export interface removeAccessMembersArgs {
users: User[]
page: Page
removeOwnSpaceAccess?: boolean
}
export const removeAccessSpaceMembers = async (args: removeAccessMembersArgs): Promise<void> => {
const { page, users } = args
const { page, users, removeOwnSpaceAccess } = args
await sidebar.open({ page: page })
await sidebar.openPanel({ page: page, name: 'space-share' })
await removeSharee({ page, users })
await removeSharee({ page, users, removeOwnSpaceAccess: removeOwnSpaceAccess })
}

export interface changeSpaceRoleArgs {
Expand Down