diff --git a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md index 9b679d44f44..f33c5ab6072 100644 --- a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md +++ b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md @@ -8,45 +8,49 @@ Level-3 headings should be used for the references to the relevant issues. Inclu Other free text and markdown formatting can be used elsewhere in the document if needed. But if you want to explain something about the issue, then please post that in the issue itself. - ### [Exit page re-appears in loop when logged in user is deleted](https://github.com/owncloud/web/issues/4677) -- [webUILogin/openidLogin.feature:50](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/openidLogin.feature#L50) -- [webUILogin/openidLogin.feature:60](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/openidLogin.feature#L60) - -### [Share additional info](https://github.com/owncloud/ocis/issues/1253) -- [webUISharingInternalUsersShareWithPage/shareWithUsers.feature:115](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature#L115) -### [Different path for shares inside folder](https://github.com/owncloud/ocis/issues/1231) +- [webUILogin/openidLogin.feature:50](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/openidLogin.feature#L50) +- [webUILogin/openidLogin.feature:60](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/openidLogin.feature#L60) ### [restoring a file deleted from a received shared folder is not possible](https://github.com/owncloud/ocis/issues/1124) -- [webUITrashbinRestore/trashbinRestore.feature:176](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature#L176) + +- [webUITrashbinRestore/trashbinRestore.feature:176](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature#L176) ### [Deletion of a recursive folder from trashbin is not possible](https://github.com/owncloud/product/issues/188) -- [webUITrashbinDelete/trashbinDelete.feature:51](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L51) -- [webUITrashbinDelete/trashbinDelete.feature:65](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L65) + +- [webUITrashbinDelete/trashbinDelete.feature:51](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L51) +- [webUITrashbinDelete/trashbinDelete.feature:65](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature#L65) ### [Saving public share is not possible](https://github.com/owncloud/web/issues/5321) -- [webUISharingPublicManagement/shareByPublicLink.feature:24](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature#L24) + +- [webUISharingPublicManagement/shareByPublicLink.feature:24](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicManagement/shareByPublicLink.feature#L24) ### [Uploading folders does not work in files-drop](https://github.com/owncloud/web/issues/2443) -- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:263](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L263) + +- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:263](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L263) ### [Resources cannot be locked under ocis](https://github.com/owncloud/ocis/issues/1284) -- [webUIWebdavLockProtection/delete.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/delete.feature#L33) -- [webUIWebdavLockProtection/delete.feature:34](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/delete.feature#L34) -- [webUIWebdavLockProtection/move.feature:36](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/move.feature#L36) -- [webUIWebdavLockProtection/move.feature:37](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/move.feature#L37) -- [webUIWebdavLockProtection/upload.feature:32](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L32) + +- [webUIWebdavLockProtection/delete.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/delete.feature#L33) +- [webUIWebdavLockProtection/delete.feature:34](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/delete.feature#L34) +- [webUIWebdavLockProtection/move.feature:36](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/move.feature#L36) +- [webUIWebdavLockProtection/move.feature:37](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/move.feature#L37) +- [webUIWebdavLockProtection/upload.feature:32](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L32) ### [Resources cannot be locked under ocis](https://github.com/owncloud/ocis/issues/1284) -- [webUIWebdavLockProtection/upload.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L33) + +- [webUIWebdavLockProtection/upload.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L33) ### [Writing to locked files/folders give only a generic error message](https://github.com/owncloud/web/issues/5741) -- [webUIWebdavLockProtection/upload.feature:32](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L32) -- [webUIWebdavLockProtection/upload.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L33) + +- [webUIWebdavLockProtection/upload.feature:32](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L32) +- [webUIWebdavLockProtection/upload.feature:33](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIWebdavLockProtection/upload.feature#L33) ### [empty subfolder inside a folder to be uploaded is not created on the server](https://github.com/owncloud/web/issues/6348) -- [webUIUpload/upload.feature:43](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIUpload/upload.feature#L43) + +- [webUIUpload/upload.feature:43](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIUpload/upload.feature#L43) ### [PROPFIND to sub-folder of a shared resources with same name gives 404](https://github.com/owncloud/ocis/issues/3859) -- [webUISharingAcceptShares/acceptShares.feature:73](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature#L73) + +- [webUISharingAcceptShares/acceptShares.feature:73](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature#L73) diff --git a/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature b/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature index 6cda890524c..64285f07d5e 100644 --- a/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature +++ b/tests/acceptance/features/webUISharingInternalUsersShareWithPage/shareWithUsers.feature @@ -102,28 +102,6 @@ Feature: Shares in share-with pages And the user browses to the shared-with-me page in declined shares view Then the unshared elements should be in declined state on the webUI - @issue-ocis-1328 - Scenario Outline: collaborators list contains additional info when enabled - Given the setting "user_additional_info_field" of app "core" has been set to "" in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has shared folder "simple-folder" with user "Brian" in the server - When user "Alice" has logged in using the webUI - And the user opens the share dialog for folder "simple-folder" using the webUI - Then user "Brian Murphy" should be listed with additional info "" in the collaborators list on the webUI - Examples: - | additional-info-field | additional-info-result | - | id | Brian | - | email | brian@example.org | - - @issue-ocis-1328 - Scenario: collaborators list does not contain additional info when disabled - Given the setting "user_additional_info_field" of app "core" has been set to "" in the server - And user "Alice" has created folder "simple-folder" in the server - And user "Alice" has shared folder "simple-folder" with user "Brian" in the server - When user "Alice" has logged in using the webUI - And the user opens the share dialog for folder "simple-folder" using the webUI - Then user "Brian Murphy" should be listed without additional info in the collaborators list on the webUI - Scenario: share a file with another internal user via collaborators quick action Given user "Alice" has created folder "simple-folder" in the server diff --git a/tests/e2e/cucumber/features/smoke/shares/share.feature b/tests/e2e/cucumber/features/smoke/shares/share.feature index 7ebe0c1d298..907c30222f4 100644 --- a/tests/e2e/cucumber/features/smoke/shares/share.feature +++ b/tests/e2e/cucumber/features/smoke/shares/share.feature @@ -6,11 +6,11 @@ Feature: share | Alice | | Brian | And "Brian" logs in - # disabling auto accepting to check accepting share - And "Brian" disables auto-accepting using API Scenario: folder - Given "Alice" logs in + # disabling auto accepting to check accepting share + Given "Brian" disables auto-accepting using API + And "Alice" logs in And "Alice" creates the following folder in personal space using API | name | | folder_to_shared | @@ -37,7 +37,6 @@ Feature: share When "Brian" accepts the following share from the context menu | name | | shared_folder | - And "Brian" creates quick link of the resource "shared_folder" with password "%public%" from the context menu And "Brian" declines the following share from the context menu | name | | shared_folder | @@ -96,18 +95,6 @@ Feature: share And "Brian" opens the "files" app And "Brian" navigates to the shared with me page - Then "Brian" should not see a sync status for the file "shareToBrian.txt" - When "Brian" accepts the following share - | name | - | shareToBrian.txt | - | shareToBrian.md | - | testavatar.jpeg | - | simple.pdf | - Then "Brian" should not see a sync status for the file "sharedFile.txt" - When "Brian" accepts the following share from the context menu - | name | - | sharedFile.txt | - And "Brian" creates quick link of the resource "sharedFile.txt" with password "%public%" from the context menu And "Brian" declines the following share from the context menu | name | | sharedFile.txt | @@ -159,13 +146,15 @@ Feature: share # set expirationDate to existing share And "Alice" sets the expiration date of share "mainFolder" of user "Brian" to "+5 days" + And "Alice" checks the following access details of share "mainFolder" for user "Brian" + | Name | Brian Murphy | + | Additional info | brian@example.org | + | Type | User | And "Alice" sets the expiration date of share "myfolder" of group "sales" to "+3 days" + And "Alice" checks the following access details of share "myfolder" for group "sales" + | Name | sales department | + | Type | Group | And "Alice" logs out And "Brian" navigates to the shared with me page - And "Brian" accepts the following share - | name | - | new.txt | - | myfolder | - | mainFolder | And "Brian" logs out diff --git a/tests/e2e/cucumber/steps/ui/shares.ts b/tests/e2e/cucumber/steps/ui/shares.ts index 6eb2e122e9a..b3817a51dd2 100644 --- a/tests/e2e/cucumber/steps/ui/shares.ts +++ b/tests/e2e/cucumber/steps/ui/shares.ts @@ -225,12 +225,11 @@ When( ) When( - /"([^"]*)" (should|should not) see a sync status for the (folder|file) "([^"]*)"?$/, + /"([^"]*)" (should|should not) see a sync status for the (?:folder|file) "([^"]*)"?$/, async function ( this: World, stepUser: string, condition: string, - _: string, resource: string ): Promise { const shouldSee = condition === 'should' @@ -261,12 +260,11 @@ Then( ) When( - /^"([^"]*)" (grants|denies) access to the following resources(s)? for (group|user) "([^"]*)" using the sidebar panel?$/, + /^"([^"]*)" (grants|denies) access to the following resources(?:s)? for (group|user) "([^"]*)" using the sidebar panel?$/, async function ( this: World, stepUser: string, actionType: string, - _: unknown, collaboratorType: 'user' | 'group', collaborator: string, stepTable: DataTable @@ -315,3 +313,31 @@ When( }) } ) + +When( + /^"([^"]*)" checks the following access details of share "([^"]*)" for (user|group) "([^"]*)"$/, + async function ( + this: World, + stepUser: string, + resource: string, + collaboratorType: string, + collaboratorName: string, + stepTable: DataTable + ): Promise { + const { page } = this.actorsEnvironment.getActor({ key: stepUser }) + const shareObject = new objects.applicationFiles.Share({ page }) + const expectedDetails = stepTable.rowsHash() + const actualDetails = await shareObject.getAccessDetails({ + resource, + collaborator: { + collaborator: + collaboratorType === 'group' + ? this.usersEnvironment.getGroup({ key: collaboratorName }) + : this.usersEnvironment.getUser({ key: collaboratorName }), + type: collaboratorType + } as ICollaborator + }) + + expect(actualDetails).toMatchObject(expectedDetails) + } +) diff --git a/tests/e2e/support/objects/app-files/share/actions.ts b/tests/e2e/support/objects/app-files/share/actions.ts index 4c2700e1121..42a025bcc65 100644 --- a/tests/e2e/support/objects/app-files/share/actions.ts +++ b/tests/e2e/support/objects/app-files/share/actions.ts @@ -1,6 +1,6 @@ import { Page, expect } from '@playwright/test' import util from 'util' -import Collaborator, { ICollaborator } from './collaborator' +import Collaborator, { ICollaborator, IAccessDetails } from './collaborator' import { sidebar } from '../utils' import { clickResource } from '../resource/actions' import { clearCurrentPopup, createLinkArgs } from '../link/actions' @@ -275,3 +275,14 @@ export const addExpirationDate = async (args: { Collaborator.setExpirationDateForCollaborator({ page, collaborator, expirationDate }) ]) } + +export const getAccessDetails = async (args: { + page: Page + resource: string + collaborator: Omit +}): Promise => { + const { page, resource, collaborator } = args + await openSharingPanel(page, resource) + + return Collaborator.getAccessDetails(page, collaborator) +} diff --git a/tests/e2e/support/objects/app-files/share/collaborator.ts b/tests/e2e/support/objects/app-files/share/collaborator.ts index 1f90b322cc1..c8945aff791 100644 --- a/tests/e2e/support/objects/app-files/share/collaborator.ts +++ b/tests/e2e/support/objects/app-files/share/collaborator.ts @@ -44,6 +44,15 @@ export interface SetDenyShareForCollaboratorArgs extends Omit + ): Promise { + const { collaborator, type } = recipient + const collaboratorRow = Collaborator.getCollaboratorUserOrGroupSelector(collaborator, type) + await page + .locator(util.format(Collaborator.collaboratorEditDropdownButton, collaboratorRow)) + .click() + await page.locator(util.format(Collaborator.showAccessDetailsButton, collaboratorRow)).click() + + return page.locator('.share-access-details-drop dl').evaluate((el) => { + const nodes = el.childNodes + const details = {} + nodes.forEach((node) => { + if (node.nodeName === 'DT') { + details[node.textContent] = node.nextSibling.textContent + } + }) + return details + }) + } } diff --git a/tests/e2e/support/objects/app-files/share/index.ts b/tests/e2e/support/objects/app-files/share/index.ts index 0e4152dbb0c..334e7af2024 100644 --- a/tests/e2e/support/objects/app-files/share/index.ts +++ b/tests/e2e/support/objects/app-files/share/index.ts @@ -2,7 +2,7 @@ import { Page } from '@playwright/test' import * as po from './actions' import { resourceIsNotOpenable, isAcceptedSharePresent, resourceIsSynced } from './utils' import { createLinkArgs } from '../link/actions' -import { ICollaborator } from './collaborator' +import { ICollaborator, IAccessDetails } from './collaborator' export class Share { #page: Page @@ -86,4 +86,17 @@ export class Share { await po.addExpirationDate({ resource, collaborator, expirationDate, page: this.#page }) await this.#page.goto(startUrl) } + + async getAccessDetails({ + resource, + collaborator + }: { + resource: string + collaborator: Omit + }): Promise { + const startUrl = this.#page.url() + const accessDetails = await po.getAccessDetails({ resource, collaborator, page: this.#page }) + await this.#page.goto(startUrl) + return accessDetails + } }