diff --git a/tests/e2e/cucumber/features/journeys/kindergarten.oc10.feature b/tests/e2e/cucumber/features/journeys/kindergarten.oc10.feature index 79130bb8173..354b95f1a1c 100644 --- a/tests/e2e/cucumber/features/journeys/kindergarten.oc10.feature +++ b/tests/e2e/cucumber/features/journeys/kindergarten.oc10.feature @@ -36,9 +36,9 @@ Feature: Kindergarten can use web to organize a day # Implementation of sharing with different roles is currently broken # since we switched to bulk creating of shares with a single dropdown And "Alice" shares the following resources using the sidebar panel - | resource | recipient | type | role | - | groups/Pre-Schools Pirates/meal plan | Brian | user | editor | - | groups/Pre-Schools Pirates/meal plan | Carol | user | viewer | + | resource | recipient | type | role | + | groups/Pre-Schools Pirates/meal plan | Brian | user | Can edit | + | groups/Pre-Schools Pirates/meal plan | Carol | user | Can view | # Then what do we check for to be confident that the above things done by Alice have worked? When "Brian" logs in And "Brian" opens the "files" app diff --git a/tests/e2e/cucumber/features/journeys/kindergarten.ocis.feature b/tests/e2e/cucumber/features/journeys/kindergarten.ocis.feature index fdeaea0b5b0..0b77f21f867 100644 --- a/tests/e2e/cucumber/features/journeys/kindergarten.ocis.feature +++ b/tests/e2e/cucumber/features/journeys/kindergarten.ocis.feature @@ -35,9 +35,9 @@ Feature: Kindergarten can use web to organize a day # Implementation of sharing with different roles is currently broken # since we switched to bulk creating of shares with a single dropdown And "Alice" shares the following resources using the sidebar panel - | resource | recipient | type | role | - | groups/Pre-Schools Pirates/meal plan | Brian | user | editor | - | groups/Pre-Schools Pirates/meal plan | Carol | user | viewer | + | resource | recipient | type | role | + | groups/Pre-Schools Pirates/meal plan | Brian | user | Can edit | + | groups/Pre-Schools Pirates/meal plan | Carol | user | Can view | # Then what do we check for to be confident that the above things done by Alice have worked? When "Brian" logs in And "Brian" opens the "files" app diff --git a/tests/e2e/cucumber/features/smoke/admin-settings/spaces.ocis.feature b/tests/e2e/cucumber/features/smoke/admin-settings/spaces.ocis.feature index 69cacff8eb0..c42ff82e707 100644 --- a/tests/e2e/cucumber/features/smoke/admin-settings/spaces.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/admin-settings/spaces.ocis.feature @@ -105,20 +105,20 @@ Feature: spaces management | name | id | | team A | team.a | And "Admin" adds the following members to the space "team A" using API - | user | role | shareType | - | Brian | editor | space | - | Carol | viewer | space | - | David | viewer | space | - | Edith | viewer | space | + | user | role | shareType | + | Brian | Can edit | space | + | Carol | Can view | space | + | David | Can view | space | + | Edith | Can view | space | 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 | manager | - | Brian | editor | - | Carol | viewer | - | David | viewer | - | Edith | viewer | + | user | role | + | Admin | Can manage | + | Brian | Can edit | + | Carol | Can view | + | David | Can view | + | Edith | Can view | And "Alice" logs out diff --git a/tests/e2e/cucumber/features/smoke/internalLink.ocis.feature b/tests/e2e/cucumber/features/smoke/internalLink.ocis.feature index ef8c4256fdc..9fb77faf2ce 100644 --- a/tests/e2e/cucumber/features/smoke/internalLink.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/internalLink.ocis.feature @@ -10,11 +10,11 @@ Feature: internal link share | name | | myfolder | And "Alice" shares the following resource using API - | resource | recipient | type | role | - | myfolder | Brian | user | editor | + | resource | recipient | type | role | + | myfolder | Brian | user | Can edit | And "Alice" opens the "files" app And "Alice" creates a public link for the resource "myfolder" using the sidebar panel - When "Alice" edits the public link named "Link" of resource "myfolder" changing role to "internal" + When "Alice" edits the public link named "Link" of resource "myfolder" changing role to "Invited people" And "Brian" opens the public link "Link" And "Brian" logs in from the internal link And "Brian" opens shared-with-me page from the internal link diff --git a/tests/e2e/cucumber/features/smoke/link.feature b/tests/e2e/cucumber/features/smoke/link.feature index 1860894afdd..b1082635008 100644 --- a/tests/e2e/cucumber/features/smoke/link.feature +++ b/tests/e2e/cucumber/features/smoke/link.feature @@ -14,7 +14,7 @@ Feature: link | lorem.txt | folderPublic | And "Alice" creates a public link for the resource "folderPublic" using the sidebar panel And "Alice" renames the most recently created public link of resource "folderPublic" to "myPublicLink" - And "Alice" edits the public link named "myPublicLink" of resource "folderPublic" changing role to "uploader" + And "Alice" edits the public link named "myPublicLink" of resource "folderPublic" changing role to "Secret File Drop" And "Alice" sets the expiration date of the public link named "myPublicLink" of resource "folderPublic" to "+5 days" And "Alice" sets the password of the public link named "myPublicLink" of resource "folderPublic" to "12345" When "Anonymous" opens the public link "myPublicLink" @@ -26,7 +26,7 @@ Feature: link | resource | from | type | | lorem.txt | folderPublic | file | | textfile.txt | folderPublic | file | - And "Alice" edits the public link named "myPublicLink" of resource "folderPublic" changing role to "editor" + And "Alice" edits the public link named "myPublicLink" of resource "folderPublic" changing role to "Can edit" And "Anonymous" refreshes the old link And "Anonymous" downloads the following public link resources using the sidebar panel | resource | type | diff --git a/tests/e2e/cucumber/features/smoke/notifications.oc10.feature b/tests/e2e/cucumber/features/smoke/notifications.oc10.feature index b1c971b9267..0c398353dd2 100644 --- a/tests/e2e/cucumber/features/smoke/notifications.oc10.feature +++ b/tests/e2e/cucumber/features/smoke/notifications.oc10.feature @@ -1,7 +1,7 @@ Feature: Notifications As a user I want to be notified - About new things that concern me + So that I can stay updated about the information Background: Given "Admin" creates following users using API @@ -18,8 +18,8 @@ Feature: Notifications And "Alice" logs in And "Alice" opens the "files" app And "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | folder_to_shared | Brian | user | editor | folder | + | resource | recipient | type | role | resourceType | + | folder_to_shared | Brian | user | Can edit | folder | When "Brian" logs in Then "Brian" should see the following notifications | message | diff --git a/tests/e2e/cucumber/features/smoke/notifications.ocis.feature b/tests/e2e/cucumber/features/smoke/notifications.ocis.feature index 138c5d858e3..5c70cb248f9 100644 --- a/tests/e2e/cucumber/features/smoke/notifications.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/notifications.ocis.feature @@ -1,7 +1,7 @@ Feature: Notifications As a user I want to be notified - About new things that concern me + So that I can stay updated about the information Scenario: User should be able to read and dismiss notifications Given "Admin" creates following users using API @@ -29,9 +29,9 @@ Feature: Notifications | team | team.1 | And "Alice" opens the "files" app When "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | folder_to_shared | Brian | user | editor | folder | - | share_to_group | sales | group | editor | folder | + | resource | recipient | type | role | resourceType | + | folder_to_shared | Brian | user | Can edit | folder | + | share_to_group | sales | group | Can edit | folder | And "Brian" logs in Then "Brian" should see the following notifications | message | @@ -44,9 +44,9 @@ Feature: Notifications And "Alice" navigates to the projects space page And "Alice" navigates to the project space "team.1" And "Alice" adds following users to the project space - | user | role | kind | - | Brian | editor | user | - | Carol | editor | user | + | user | role | kind | + | Brian | Can edit | user | + | Carol | Can edit | user | Then "Alice" should see no notifications And "Brian" should see the following notifications | message | @@ -54,13 +54,13 @@ Feature: Notifications | Alice Hansen added you to Space team | And "Brian" marks all notifications as read When "Alice" removes access to following users from the project space - | user | role | kind | - | Carol | editor | user | + | user | role | kind | + | Carol | Can edit | user | And "Carol" logs in Then "Carol" should see the following notifications | message | | Alice Hansen added you to Space team | - | Alice Hansen removed you from Space team | + | Alice Hansen removed you from Space team | And "Carol" logs out When "Alice" opens the "admin-settings" app And "Alice" navigates to the project spaces management page diff --git a/tests/e2e/cucumber/features/smoke/reshare.feature b/tests/e2e/cucumber/features/smoke/reshare.feature index fc89560b69d..9f06c2a22ab 100644 --- a/tests/e2e/cucumber/features/smoke/reshare.feature +++ b/tests/e2e/cucumber/features/smoke/reshare.feature @@ -21,8 +21,8 @@ Feature: reshare | name | | folder_to_shared | And "Alice" shares the following resource using API - | resource | recipient | type | role | - | folder_to_shared | Brian | user | editor | + | resource | recipient | type | role | + | folder_to_shared | Brian | user | Can edit | And "Brian" logs in And "Brian" accepts the following share using API | name | @@ -31,8 +31,8 @@ Feature: reshare And "Brian" opens the "files" app And "Brian" navigates to the shared with me page And "Brian" reshares the following resource - | resource | recipient | type | role | resourceType | - | folder_to_shared | sales | group | viewer | folder | + | resource | recipient | type | role | resourceType | + | folder_to_shared | sales | group | Can view | folder | And "Carol" logs in And "Carol" opens the "files" app @@ -41,8 +41,8 @@ Feature: reshare | name | | folder_to_shared | And "Carol" reshares the following resource - | resource | recipient | type | role | resourceType | - | folder_to_shared | Alice | user | viewer | folder | + | resource | recipient | type | role | resourceType | + | folder_to_shared | Alice | user | Can view | folder | And "Alice" opens the "files" app And "Alice" navigates to the personal space page diff --git a/tests/e2e/cucumber/features/smoke/search.feature b/tests/e2e/cucumber/features/smoke/search.feature index ba41be46d92..f998c69dab0 100644 --- a/tests/e2e/cucumber/features/smoke/search.feature +++ b/tests/e2e/cucumber/features/smoke/search.feature @@ -21,9 +21,9 @@ Feature: Search | filesForUpload/new-lorem-big.txt | new-lorem-big.txt | And "Brian" opens the "files" app And "Brian" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | new_share_from_brian | Alice | user | viewer | folder | - | new-lorem-big.txt | Alice | user | viewer | file | + | resource | recipient | type | role | resourceType | + | new_share_from_brian | Alice | user | Can view | folder | + | new-lorem-big.txt | Alice | user | Can view | file | And "Brian" logs out When "Alice" logs in diff --git a/tests/e2e/cucumber/features/smoke/share.oc10.feature b/tests/e2e/cucumber/features/smoke/share.oc10.feature index d940df9e5f8..341e60b4a6a 100644 --- a/tests/e2e/cucumber/features/smoke/share.oc10.feature +++ b/tests/e2e/cucumber/features/smoke/share.oc10.feature @@ -22,7 +22,7 @@ Feature: share | lorem-big.txt | folder_to_customShared | When "Alice" shares the following resource using the sidebar panel | resource | recipient | type | role | resourceType | - | folder_to_shared | Brian | user | editor | folder | + | folder_to_shared | Brian | user | Can edit | folder | | folder_to_customShared | Brian | user | custom_permissions:read,create,delete | folder | And "Brian" logs in And "Brian" opens the "files" app @@ -78,7 +78,7 @@ Feature: share | lorem.txt | | And "Alice" shares the following resource using the quick action | resource | recipient | type | role | - | folder_to_shared/testavatar.jpeg | Brian | user | viewer | + | folder_to_shared/testavatar.jpeg | Brian | user | Can view | | lorem.txt | Brian | user | custom_permissions:read,update,share | And "Brian" logs in And "Brian" opens the "files" app @@ -95,8 +95,8 @@ Feature: share | resource | from | type | | testavatar.jpeg | Shares | file | And "Alice" updates following sharee role - | resource | recipient | role | resourceType | - | folder_to_shared/testavatar.jpeg | Brian | editor | file | + | resource | recipient | role | resourceType | + | folder_to_shared/testavatar.jpeg | Brian | Can edit | file | And "Brian" renames the following resource | resource | as | | Shares/testavatar.jpeg | testavatar_new.jpeg | diff --git a/tests/e2e/cucumber/features/smoke/share.ocis.feature b/tests/e2e/cucumber/features/smoke/share.ocis.feature index 2740dea282b..06fc5632b93 100644 --- a/tests/e2e/cucumber/features/smoke/share.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/share.ocis.feature @@ -20,8 +20,8 @@ Feature: share | lorem-big.txt | folder_to_customShared | When "Alice" shares the following resource using the sidebar panel | resource | recipient | type | role | resourceType | - | folder_to_shared | Brian | user | editor | folder | - | shared_folder | Brian | user | editor | folder | + | folder_to_shared | Brian | user | Can edit | folder | + | shared_folder | Brian | user | Can edit | folder | | folder_to_customShared | Brian | user | custom_permissions:read,create,delete | folder | And "Brian" logs in And "Brian" opens the "files" app @@ -88,11 +88,11 @@ Feature: share | simple.pdf | When "Alice" shares the following resource using the sidebar panel | resource | recipient | type | role | resourceType | - | shareToBrian.txt | Brian | user | editor | file | - | shareToBrian.md | Brian | user | editor | file | - | testavatar.jpeg | Brian | user | viewer | file | + | shareToBrian.txt | Brian | user | Can edit | file | + | shareToBrian.md | Brian | user | Can edit | file | + | testavatar.jpeg | Brian | user | Can view | file | | simple.pdf | Brian | user | custom_permissions:read,update,share | file | - | sharedFile.txt | Brian | user | editor | file | + | sharedFile.txt | Brian | user | Can edit | file | And "Brian" logs in And "Brian" opens the "files" app And "Brian" navigates to the shared with me page diff --git a/tests/e2e/cucumber/features/smoke/spaces/internalLink.ocis.feature b/tests/e2e/cucumber/features/smoke/spaces/internalLink.ocis.feature index 615e30052a7..a4b0aa8c56d 100644 --- a/tests/e2e/cucumber/features/smoke/spaces/internalLink.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/spaces/internalLink.ocis.feature @@ -21,18 +21,18 @@ Feature: internal link share in project space And "Alice" navigates to the projects space page And "Alice" navigates to the project space "marketing.1" And "Alice" adds following users to the project space - | user | role | kind | - | Brian | editor | user | + | user | role | kind | + | Brian | Can edit | user | And "Alice" creates a public link for the resource "myfolder" using the sidebar panel - When "Alice" edits the public link named "Link" of resource "myfolder" changing role to "internal" + When "Alice" edits the public link named "Link" of resource "myfolder" changing role to "Invited people" And "Brian" opens the public link "Link" And "Brian" logs in from the internal link And "Brian" uploads the following resource in internal link named "Link" | resource | | simple.pdf | When "Alice" changes the roles of the following users in the project space - | user | role | - | Brian | viewer | + | user | role | + | Brian | Can view | And "Alice" logs out And "Brian" reloads the spaces page Then "Brian" should see file "plan.txt" but should not be able to edit diff --git a/tests/e2e/cucumber/features/smoke/spaces/memberExpiry.ocis.feature b/tests/e2e/cucumber/features/smoke/spaces/memberExpiry.ocis.feature index dfa59cf3207..e17a0db5999 100644 --- a/tests/e2e/cucumber/features/smoke/spaces/memberExpiry.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/spaces/memberExpiry.ocis.feature @@ -16,8 +16,8 @@ Feature: spaces member expiry And "Alice" navigates to the projects space page And "Alice" navigates to the project space "team.1" And "Alice" adds following users to the project space - | user | role | kind | - | Brian | editor | user | + | user | role | kind | + | Brian | Can edit | user | And "Alice" sets the expiration date of the member "Brian" of the project space to "+5 days" When "Brian" logs in And "Brian" navigates to the projects space page diff --git a/tests/e2e/cucumber/features/smoke/spaces/participantManagement.ocis.feature b/tests/e2e/cucumber/features/smoke/spaces/participantManagement.ocis.feature index a6cdfde6b18..dc8f6c5d4cb 100644 --- a/tests/e2e/cucumber/features/smoke/spaces/participantManagement.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/spaces/participantManagement.ocis.feature @@ -27,11 +27,11 @@ Feature: spaces participant management And "Alice" navigates to the projects space page And "Alice" navigates to the project space "team.1" And "Alice" adds following users to the project space - | user | role | kind | - | Brian | editor | user | - | Carol | viewer | user | - | sales | viewer | group | - | security | editor | group | + | user | role | kind | + | Brian | Can edit | user | + | Carol | Can view | user | + | sales | Can view | group | + | security | Can edit | group | When "Brian" logs in And "Brian" navigates to the projects space page And "Brian" navigates to the project space "team.1" @@ -63,7 +63,7 @@ Feature: spaces participant management # page reload is necessary to fetch all the changes made by user Brian When "Alice" reloads the spaces page And "Alice" creates a public link for the resource "parent" using the sidebar panel - And "Alice" edits the public link named "Link" of resource "parent" changing role to "editor" + And "Alice" edits the public link named "Link" of resource "parent" changing role to "Can edit" And "Anonymous" opens the public link "Link" And "Anonymous" uploads the following resources in public link page | resource | diff --git a/tests/e2e/cucumber/features/smoke/spaces/project.ocis.feature b/tests/e2e/cucumber/features/smoke/spaces/project.ocis.feature index 33c55d123fe..deaca9501e7 100644 --- a/tests/e2e/cucumber/features/smoke/spaces/project.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/spaces/project.ocis.feature @@ -50,14 +50,14 @@ Feature: spaces.personal And "Alice" creates a public link for the resource "folderPublic" using the sidebar panel And "Alice" renames the most recently created public link of resource "folderPublic" to "team.1" - And "Alice" edits the public link named "team.1" of resource "folderPublic" changing role to "uploader" + And "Alice" edits the public link named "team.1" of resource "folderPublic" changing role to "Secret File Drop" And "Alice" sets the expiration date of the public link named "team.1" of resource "folderPublic" to "+5 days" And "Alice" sets the password of the public link named "team.1" of resource "folderPublic" to "12345" # borrowed from share.feature When "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | folder_to_shared | Brian | user | editor | folder | + | resource | recipient | type | role | resourceType | + | folder_to_shared | Brian | user | Can edit | folder | # team.2 And "Alice" navigates to the projects space page @@ -77,7 +77,7 @@ Feature: spaces.personal And "Alice" creates a public link for the resource "folderPublic" using the sidebar panel And "Alice" renames the most recently created public link of resource "folderPublic" to "team.2" - And "Alice" edits the public link named "team.2" of resource "folderPublic" changing role to "uploader" + And "Alice" edits the public link named "team.2" of resource "folderPublic" changing role to "Secret File Drop" And "Alice" sets the expiration date of the public link named "team.2" of resource "folderPublic" to "+5 days" And "Alice" sets the password of the public link named "team.2" of resource "folderPublic" to "54321" @@ -151,9 +151,9 @@ Feature: spaces.personal | resource | to | option | | textfile.txt | parent | replace | And "Alice" adds following users to the project space - | user | role | kind | - | Carol | viewer | user | - | Brian | editor | user | + | user | role | kind | + | Carol | Can view | user | + | Brian | Can edit | user | And "Alice" logs out When "Carol" logs in diff --git a/tests/e2e/cucumber/features/smoke/spaces/publicLink.ocis.feature b/tests/e2e/cucumber/features/smoke/spaces/publicLink.ocis.feature index d31be144014..bbf22749cc6 100644 --- a/tests/e2e/cucumber/features/smoke/spaces/publicLink.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/spaces/publicLink.ocis.feature @@ -22,10 +22,10 @@ Feature: spaces public link 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 | kind | - | Brian | editor | user | - | Carol | viewer | user | - | David | manager | user | + | user | role | kind | + | Brian | Can edit | user | + | Carol | Can view | user | + | David | Can manage | user | And "Alice" logs out When "Brian" logs in And "Brian" navigates to the projects space page @@ -35,7 +35,7 @@ Feature: spaces public link When "David" logs in And "David" navigates to the projects space page And "David" navigates to the project space "team.1" - And "David" edits the public link named "folderLink" of resource "spaceFolder" changing role to "editor" + And "David" edits the public link named "folderLink" of resource "spaceFolder" changing role to "Can edit" And "David" logs out When "Carol" logs in And "Carol" navigates to the projects space page diff --git a/tests/e2e/cucumber/features/smoke/tags.ocis.feature b/tests/e2e/cucumber/features/smoke/tags.ocis.feature index 9b30103f519..10e28ce2cab 100644 --- a/tests/e2e/cucumber/features/smoke/tags.ocis.feature +++ b/tests/e2e/cucumber/features/smoke/tags.ocis.feature @@ -66,8 +66,8 @@ Feature: Users can use web to organize tags | resource | tags | | folder_to_shared/lorem.txt | tag 1, tag 2 | When "Alice" shares the following resource using the sidebar panel - | resource | recipient | type | role | resourceType | - | folder_to_shared | Brian | user | editor | folder | + | resource | recipient | type | role | resourceType | + | folder_to_shared | Brian | user | Can edit | folder | And "Alice" logs out And "Brian" logs in diff --git a/tests/e2e/cucumber/steps/ui/adminSettings.ts b/tests/e2e/cucumber/steps/ui/adminSettings.ts index 57ac4623eb6..7a2df9c3d00 100644 --- a/tests/e2e/cucumber/steps/ui/adminSettings.ts +++ b/tests/e2e/cucumber/steps/ui/adminSettings.ts @@ -2,6 +2,7 @@ import { DataTable, Then, When } from '@cucumber/cucumber' import { World } from '../../environment' import { objects } from '../../../support' import { expect } from '@playwright/test' +import { shareRoles } from '../../../support/objects/app-files/share/collaborator' Then( /^"([^"]*)" (should|should not) see the following space(?:s)?$/, @@ -514,7 +515,7 @@ Then( editor: await spacesObject.listMembers({ filter: 'editors' }) } for (const info of stepTable.hashes()) { - expect(actualMemberList[info.role]).toContain(info.user) + expect(actualMemberList[shareRoles[info.role]]).toContain(info.user) } } ) diff --git a/tests/e2e/support/api/share/share.ts b/tests/e2e/support/api/share/share.ts index 4ebf1f3624e..d3b6458d577 100644 --- a/tests/e2e/support/api/share/share.ts +++ b/tests/e2e/support/api/share/share.ts @@ -1,9 +1,11 @@ -import { checkResponseStatus, request } from '../http' -import { User } from '../../types' import join from 'join-path' import convert from 'xml-js' import _ from 'lodash/object' +import { checkResponseStatus, request } from '../http' +import { User } from '../../types' +import { shareRoles } from '../../objects/app-files/share/collaborator' + export const shareTypes: Readonly<{ user: string group: string @@ -39,7 +41,7 @@ export const createShare = async ({ body.append('path', path) body.append('shareWith', shareWith) body.append('shareType', shareTypes[shareType]) - body.append('role', role) + body.append('role', shareRoles[role]) body.append('name', name) if (space_ref) { body.append('space_ref', space_ref) diff --git a/tests/e2e/support/objects/app-files/link/actions.ts b/tests/e2e/support/objects/app-files/link/actions.ts index 43309fb0da9..0a0374ecbfc 100644 --- a/tests/e2e/support/objects/app-files/link/actions.ts +++ b/tests/e2e/support/objects/app-files/link/actions.ts @@ -4,6 +4,7 @@ import util from 'util' import { sidebar } from '../utils' import { getActualExpiryDate } from '../../../utils/datePicker' import { clickResource } from '../resource/actions' +import { shareRoles } from '../share/collaborator' export interface createLinkArgs { page: Page @@ -126,7 +127,7 @@ export const changeRole = async (args: changeRoleArgs): Promise => { res.request().method() === 'PUT' && res.status() === 200 ), - page.locator(util.format(publicLinkSetRoleButton, role.toLowerCase())).click() + page.locator(util.format(publicLinkSetRoleButton, shareRoles[role])).click() ]) const message = await page.locator(linkUpdateDialog).textContent() diff --git a/tests/e2e/support/objects/app-files/link/index.ts b/tests/e2e/support/objects/app-files/link/index.ts index 14099b7ed4b..edb7c3c2af4 100644 --- a/tests/e2e/support/objects/app-files/link/index.ts +++ b/tests/e2e/support/objects/app-files/link/index.ts @@ -12,11 +12,11 @@ export class Link { } roleDisplayText = { - internal: 'Only for invited people', - viewer: 'Anyone with the link can view', - contributor: 'Anyone with the link can upload', - editor: 'Anyone with the link can edit', - uploader: 'Secret File drop' + 'Invited people': 'Only for invited people', + 'Can view': 'Anyone with the link can view', + 'Can upload': 'Anyone with the link can upload', + 'Can edit': 'Anyone with the link can edit', + 'Secret File Drop': 'Secret File drop' } async create(args: Omit): Promise { const startUrl = this.#page.url() diff --git a/tests/e2e/support/objects/app-files/share/collaborator.ts b/tests/e2e/support/objects/app-files/share/collaborator.ts index 9caf0de1a50..4eeaf611529 100644 --- a/tests/e2e/support/objects/app-files/share/collaborator.ts +++ b/tests/e2e/support/objects/app-files/share/collaborator.ts @@ -40,6 +40,22 @@ export interface RemoveExpirationDateFromCollaboratorArgs export type CollaboratorType = 'user' | 'group' export type CustomPermissionType = 'read' | 'update' | 'create' | 'delete' | 'share' +export const shareRoles: Readonly<{ + 'Invited people': string + 'Can upload': string + 'Can manage': string + 'Can edit': string + 'Can view': string + 'Secret File Drop': string +}> = { + 'Invited people': 'internal', + 'Can upload': 'contributor', + 'Can manage': 'manager', + 'Can edit': 'editor', + 'Can view': 'viewer', + 'Secret File Drop': 'uploader' +} + export default class Collaborator { private static readonly invitePanel = '//*[@id="oc-files-sharing-sidebar"]' private static readonly inviteInput = '#files-share-invite-input' @@ -195,7 +211,7 @@ export default class Collaborator { return await page.click(Collaborator.customPermissionApplyButton) } - return await page.click(util.format(itemSelector, role)) + return await page.click(util.format(itemSelector, shareRoles[role])) } static async changeCollaboratorRole(args: CollaboratorArgs): Promise {