diff --git a/.drone.star b/.drone.star index 0e701f5dd76..61897dd6c62 100644 --- a/.drone.star +++ b/.drone.star @@ -34,11 +34,13 @@ config = { 'webUISharingFolderPermissionsGroups': 'SharingFolderPermissionsGroups', 'webUISharingFolderAdvancedPermissionsGroups': 'SharingFolderAdvPermissionsGrp', 'webUIResharing': 'Resharing', + 'webUIResharingToRoot': 'ResharingToRoot', 'webUISharingPublic': 'SharingPublic', 'webUISharingPublicDifferentRoles': 'SharingPublicDifferentRoles', 'webUITrashbin': 'Trashbin', 'webUIUpload': 'Upload', 'webUISharingAcceptShares': 'SharingAcceptShares', + 'webUISharingAcceptSharesToRoot': 'SharingAcceptSharesRoot', 'webUISharingFilePermissionMultipleUsers': 'SharingFilePermissionMultipleUsers', 'webUISharingFolderPermissionMultipleUsers': 'SharingFolderPermissionMultipleUsers', 'webUISharingFolderAdvancedPermissionMultipleUsers': 'SharingFolderAdvancedPermissionMU', diff --git a/tests/acceptance/features/webUIResharing/reshareUsers.feature b/tests/acceptance/features/webUIResharing/reshareUsers.feature index f2ccc9a0f89..fd60d8108be 100644 --- a/tests/acceptance/features/webUIResharing/reshareUsers.feature +++ b/tests/acceptance/features/webUIResharing/reshareUsers.feature @@ -5,45 +5,58 @@ Feature: Resharing shared files with different permissions So that I can control the access on those files/folders by other collaborators Background: - Given these users have been created with default attributes: + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And the administrator has set the default folder for received shares to "Shares" + And these users have been created with default attributes: | username | | user1 | | user2 | | user3 | Scenario: Reshare a folder without share permissions using API and check if it is listed on the collaborators list for original owner - Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions - And user "user1" has shared folder "simple-folder (2)" with user "user3" with "read" permissions - And user "user2" has logged in using the webUI - When the user opens the share dialog for folder "simple-folder" using the webUI - Then user "User Three" should be listed as "Viewer" in the collaborators list for folder "simple-folder" on the webUI - And no custom permissions should be set for collaborator "User Three" for folder "simple-folder" on the webUI + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" + And user "user1" has shared folder "Shares/simple-folder" with user "user3" with "read" permissions + And user "user3" has accepted the share "simple-folder" offered by user "user1" + And user "user2" has logged in using the webUI + When the user opens the share dialog for folder "simple-folder" using the webUI + Then user "User Three" should be listed as "Viewer" in the collaborators list for folder "simple-folder" on the webUI + And no custom permissions should be set for collaborator "User Three" for folder "simple-folder" on the webUI Scenario: Reshare a folder without share permissions using API and check if it is listed on the collaborators list for resharer - Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions - And user "user1" has shared folder "simple-folder (2)" with user "user3" with "read" permissions - And user "user1" has logged in using the webUI - When the user opens the share dialog for folder "simple-folder (2)" using the webUI - Then user "User Three" should be listed as "Viewer" in the collaborators list for folder "simple-folder (2)" on the webUI - And no custom permissions should be set for collaborator "User Three" for folder "simple-folder (2)" on the webUI + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" + And user "user1" has shared folder "Shares/simple-folder" with user "user3" with "read" permissions + And user "user3" has accepted the share "simple-folder" offered by user "user1" + And user "user1" has logged in using the webUI + And the user opens folder "Shares" using the webUI + When the user opens the share dialog for folder "simple-folder" using the webUI + Then user "User Three" should be listed as "Viewer" in the collaborators list for folder "simple-folder" on the webUI + And no custom permissions should be set for collaborator "User Three" for folder "simple-folder" on the webUI Scenario: Reshare a folder without share permissions using API and check if the receiver can reshare Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions - And user "user1" has shared folder "simple-folder (2)" with user "user3" with "read" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" + And user "user1" has shared folder "/Shares/simple-folder" with user "user3" with "read" permissions + And user "user3" has accepted the share "simple-folder" offered by user "user1" When user "user3" logs in using the webUI - Then the user should not be able to share folder "simple-folder (2)" using the webUI + And the user opens folder "Shares" using the webUI + Then the user should not be able to share folder "simple-folder" using the webUI Scenario Outline: share a received folder with another user with same permissions(including share permissions) and check if the user is displayed in collaborators list for resharer Given user "user2" has shared folder "simple-folder" with user "user1" with "" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" And user "user1" has logged in using the webUI - When the user shares folder "simple-folder (2)" with user "User Three" as "" with permissions "" using the webUI - Then user "User Three" should be listed as "" in the collaborators list for folder "simple-folder (2)" on the webUI - And custom permissions "" should be set for user "User Three" for folder "simple-folder (2)" on the webUI - And user "user3" should have received a share with these details: + And the user opens folder "Shares" using the webUI + When the user shares folder "simple-folder" with user "User Three" as "" with permissions "" using the webUI + And user "user3" accepts the share "simple-folder" offered by user "user1" + Then user "User Three" should be listed as "" in the collaborators list for folder "simple-folder" on the webUI + And custom permissions "" should be set for user "User Three" for folder "simple-folder" on the webUI + Then user "user3" should have received a share with these details: | field | value | | uid_owner | user1 | | share_with | user3 | - | file_target | /simple-folder (2) | + | file_target | /Shares/simple-folder | | item_type | folder | | permissions | | Examples: @@ -56,8 +69,11 @@ Feature: Resharing shared files with different permissions Scenario Outline: share a received folder with another user with same permissions(including share permissions) and check if the user is displayed in collaborators list for original owner Given user "user2" has shared folder "simple-folder" with user "user1" with "" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" And user "user1" has logged in using the webUI - When the user shares folder "simple-folder (2)" with user "User Three" as "" with permissions "" using the webUI + And the user opens folder "Shares" using the webUI + When the user shares folder "simple-folder" with user "User Three" as "" with permissions "" using the webUI + And user "user3" accepts the share "simple-folder" offered by user "user1" And the user re-logs in as "user2" using the webUI Then user "User Three" should be listed as "" in the collaborators list for folder "simple-folder" on the webUI And custom permissions "" should be set for user "User Three" for folder "simple-folder" on the webUI @@ -67,14 +83,14 @@ Feature: Resharing shared files with different permissions | field | value | | uid_owner | user1 | | share_with | user3 | - | file_target | /simple-folder (2) | + | file_target | /Shares/simple-folder | | item_type | folder | | permissions | | And user "user1" should have received a share with these details: | field | value | | uid_owner | user2 | | share_with | user1 | - | file_target | /simple-folder (2) | + | file_target | /Shares/simple-folder | | item_type | folder | | permissions | | Examples: @@ -87,8 +103,11 @@ Feature: Resharing shared files with different permissions Scenario: share a folder with another user with share permissions and reshare without share permissions to different user, and check if user is displayed for original sharer Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" And user "user1" has logged in using the webUI - When the user shares folder "simple-folder (2)" with user "User Three" as "Viewer" with permissions "," using the webUI + And the user opens folder "Shares" using the webUI + When the user shares folder "simple-folder" with user "User Three" as "Viewer" with permissions "," using the webUI + And user "user3" accepts the share "simple-folder" offered by user "user1" And the user re-logs in as "user2" using the webUI Then user "User Three" should be listed as "Viewer" in the collaborators list for folder "simple-folder" on the webUI And no custom permissions should be set for collaborator "User Three" for folder "simple-folder" on the webUI @@ -98,70 +117,85 @@ Feature: Resharing shared files with different permissions | field | value | | uid_owner | user2 | | share_with | user1 | - | file_target | /simple-folder (2) | + | file_target | /Shares/simple-folder | | item_type | folder | | permissions | read, share | And user "user3" should have received a share with these details: | field | value | | uid_owner | user1 | | share_with | user3 | - | file_target | /simple-folder (2) | + | file_target | /Shares/simple-folder | | item_type | folder | | permissions | read | Scenario: share a folder with another user with share permissions and reshare without share permissions to different user, and check if user is displayed for the receiver Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" And user "user1" has logged in using the webUI - When the user shares folder "simple-folder (2)" with user "User Three" as "Viewer" with permissions "," using the webUI + And the user opens folder "Shares" using the webUI + When the user shares folder "simple-folder" with user "User Three" as "Viewer" with permissions "," using the webUI + And user "user3" accepts the share "simple-folder" offered by user "user1" And user "user3" should have received a share with these details: | field | value | | uid_owner | user1 | | share_with | user3 | - | file_target | /simple-folder (2) | + | file_target | /Shares/simple-folder | | item_type | folder | | permissions | read | Scenario Outline: share a file/folder without share permissions and check if another user can reshare Given user "user2" has shared folder "" with user "user1" with "read" permissions + And user "user1" has accepted the share "" offered by user "user2" When user "user1" logs in using the webUI - Then the user should not be able to share resource "" using the webUI + And the user opens folder "Shares" using the webUI + Then the user should not be able to share resource "" using the webUI Examples: - | shared-entry-name | received-entry-name | - | simple-folder | simple-folder (2) | - | lorem.txt | lorem (2).txt | - | simple-folder | simple-folder (2) | - | lorem.txt | lorem (2).txt | + | shared-entry-name | + | simple-folder | + | lorem.txt | + | simple-folder | + | lorem.txt | Scenario Outline: share a received file/folder without share permissions and check if another user can reshare Given user "user2" has shared folder "" with user "user1" with "all" permissions - And user "user1" has shared folder "" with user "user3" with "read" permissions + And user "user1" has accepted the share "" offered by user "user2" + And user "user1" has shared folder "/Shares/" with user "user3" with "read" permissions + And user "user3" has accepted the share "" offered by user "user1" When user "user3" logs in using the webUI - Then the user should not be able to share resource "" using the webUI + And the user opens folder "Shares" using the webUI + Then the user should not be able to share resource "" using the webUI Examples: - | shared-entry-name | received-entry-name | - | simple-folder | simple-folder (2) | - | lorem.txt | lorem (2).txt | + | shared-entry-name | + | simple-folder | + | lorem.txt | Scenario: User is allowed to reshare a file/folder with the equivalent received permissions, and collaborators should not be listed for the receiver Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share, delete" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" And user "user1" has logged in using the webUI - When the user shares folder "simple-folder (2)" with user "User Three" as "Advanced permissions" with permissions "share, delete" using the webUI + And the user opens folder "Shares" using the webUI + When the user shares folder "simple-folder" with user "User Three" as "Advanced permissions" with permissions "share, delete" using the webUI + And user "user3" accepts the share "simple-folder" offered by user "user1" And the user re-logs in as "user3" using the webUI - And the user opens the share dialog for folder "simple-folder (2)" using the webUI + And the user opens folder "Shares" using the webUI + And the user opens the share dialog for folder "simple-folder" using the webUI Then the current collaborators list should have order "User Two,User Three" And user "User Two" should be listed as "Owner" reshared through "User One" in the collaborators list on the webUI And user "user3" should have received a share with these details: | field | value | | uid_owner | user1 | | share_with | user3 | - | file_target | /simple-folder (2) | + | file_target | /Shares/simple-folder | | item_type | folder | | permissions | share, delete, read | Scenario: User is allowed to reshare a file/folder with the lesser permissions, and check if it is listed for original owner Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share, delete" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" And user "user1" has logged in using the webUI - When the user shares folder "simple-folder (2)" with user "User Three" as "Advanced permissions" with permissions "delete" using the webUI + And the user opens folder "Shares" using the webUI + When the user shares folder "simple-folder" with user "User Three" as "Advanced permissions" with permissions "delete" using the webUI + And user "user3" accepts the share "simple-folder" offered by user "user1" And the user re-logs in as "user2" using the webUI Then user "User One" should be listed as "Advanced permissions" in the collaborators list for folder "simple-folder" on the webUI And custom permissions "share, delete" should be set for user "User One" for folder "simple-folder" on the webUI @@ -171,53 +205,70 @@ Feature: Resharing shared files with different permissions | field | value | | uid_owner | user1 | | share_with | user3 | - | file_target | /simple-folder (2) | + | file_target | /Shares/simple-folder | | item_type | folder | | permissions | delete, read | Scenario: User is not allowed to reshare a file/folder with the higher permissions Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share, delete" permissions + And user "user1" has accepted the share "simple-folder" offered by user "user2" And user "user1" has logged in using the webUI - When the user shares folder "simple-folder (2)" with user "User Three" as "Advanced permissions" with permissions "share, delete, update" using the webUI + When the user opens folder "Shares" using the webUI + And the user shares folder "simple-folder" with user "User Three" as "Advanced permissions" with permissions "share, delete, update" using the webUI Then the error message with header "Error while sharing." should be displayed on the webUI - And as "user3" folder "simple-folder (2)" should not exist + And as "user3" folder "Shares/simple-folder" should not exist + And user "user3" should not have received any shares Scenario: Reshare a file and folder from shared with me page Given user "user1" has shared folder "simple-folder" with user "user2" + And user "user2" has accepted the share "simple-folder" offered by user "user1" And user "user1" has shared file "lorem.txt" with user "user2" + And user "user2" has accepted the share "lorem.txt" offered by user "user1" And user "user2" has logged in using the webUI And the user has browsed to the shared-with-me page - When the user shares folder "simple-folder (2)" with user "User Three" as "Editor" using the webUI - And the user shares file "lorem (2).txt" with user "User Three" as "Editor" using the webUI - Then as "user3" folder "simple-folder (2)" should exist - And as "user3" file "lorem (2).txt" should exist + When the user shares folder "simple-folder" with user "User Three" as "Editor" using the webUI + And the user shares file "lorem.txt" with user "User Three" as "Editor" using the webUI + And user "user3" accepts the share "simple-folder" offered by user "user2" + And user "user3" accepts the share "lorem.txt" offered by user "user2" + Then as "user3" folder "/Shares/simple-folder" should exist + And as "user3" file "/Shares/lorem.txt" should exist Scenario: Reshare a file and folder from shared with others page Given user "user1" has shared folder "simple-folder" with user "user2" + And user "user2" has accepted the share "simple-folder" offered by user "user1" And user "user1" has shared file "lorem.txt" with user "user2" + And user "user2" has accepted the share "lorem.txt" offered by user "user1" And user "user1" has logged in using the webUI And the user has browsed to the shared-with-others page When the user shares folder "simple-folder" with user "User Three" as "Editor" using the webUI And the user shares file "lorem.txt" with user "User Three" as "Editor" using the webUI - Then as "user3" folder "simple-folder (2)" should exist - And as "user3" file "lorem (2).txt" should exist + When user "user3" accepts the share "simple-folder" offered by user "user1" + And user "user3" accepts the share "lorem.txt" offered by user "user1" + Then as "user3" folder "/Shares/simple-folder" should exist + And as "user3" file "/Shares/lorem.txt" should exist Scenario: Reshare a file and folder from favorites page Given user "user1" has shared folder "simple-folder" with user "user2" + And user "user2" has accepted the share "simple-folder" offered by user "user1" And user "user1" has shared file "lorem.txt" with user "user2" - And user "user2" has favorited element "simple-folder (2)" - And user "user2" has favorited element "lorem (2).txt" + And user "user2" has accepted the share "lorem.txt" offered by user "user1" + And user "user2" has favorited element "/Shares/simple-folder" + And user "user2" has favorited element "/Shares/lorem.txt" And user "user2" has logged in using the webUI When the user browses to the favorites page using the webUI - And the user shares folder "simple-folder (2)" with user "User Three" as "Editor" using the webUI - And the user shares file "lorem (2).txt" with user "User Three" as "Editor" using the webUI - Then as "user3" folder "simple-folder (2)" should exist - And as "user3" file "lorem (2).txt" should exist + And the user shares folder "Shares/simple-folder" with user "User Three" as "Editor" using the webUI + And the user shares file "Shares/lorem.txt" with user "User Three" as "Editor" using the webUI + And user "user3" accepts the share "simple-folder" offered by user "user2" + And user "user3" accepts the share "lorem.txt" offered by user "user2" + Then as "user3" folder "/Shares/simple-folder" should exist + And as "user3" file "/Shares/lorem.txt" should exist Scenario: Resource owner sees resharer in collaborators list Given user "user3" has been created with default attributes And user "user1" has shared folder "simple-folder" with user "user2" - And user "user2" has shared folder "simple-folder (2)" with user "user3" + And user "user2" has accepted the share "simple-folder" offered by user "user1" + And user "user2" has shared folder "/Shares/simple-folder" with user "user3" + And user "user3" has accepted the share "simple-folder" offered by user "user2" When user "user1" has logged in using the webUI And the user opens the share dialog for folder "simple-folder" using the webUI Then user "User Two" should be listed as "Editor" in the collaborators list on the webUI @@ -229,10 +280,13 @@ Feature: Resharing shared files with different permissions And group "user4grp" has been created And user "user4" has been added to group "user4grp" And user "user1" has shared folder "simple-folder" with user "user2" + And user "user2" has accepted the share "simple-folder" offered by user "user1" And user "user1" has shared folder "simple-folder" with user "user3" - And user "user2" has shared folder "simple-folder (2)" with user "user4" - And user "user3" has shared folder "simple-folder (2)" with group "user4grp" + And user "user3" has accepted the share "simple-folder" offered by user "user1" + And user "user2" has shared folder "/Shares/simple-folder" with user "user4" + And user "user3" has shared folder "/Shares/simple-folder" with group "user4grp" + And user "user4" has accepted the share "simple-folder" offered by user "user2" When user "user4" has logged in using the webUI - And the user opens the share dialog for folder "simple-folder (2)" using the webUI - Then user "User One" should be listed as "Owner" reshared through "User Three, User Two" in the collaborators list on the webUI - + When the user opens folder "Shares" using the webUI + And the user opens the share dialog for folder "simple-folder" using the webUI + Then user "User One" should be listed as "Owner" reshared through "User Three, User Two" in the collaborators list on the webUI \ No newline at end of file diff --git a/tests/acceptance/features/webUIResharingToRoot/reshareUsers.feature b/tests/acceptance/features/webUIResharingToRoot/reshareUsers.feature new file mode 100644 index 00000000000..40fc4d3359e --- /dev/null +++ b/tests/acceptance/features/webUIResharingToRoot/reshareUsers.feature @@ -0,0 +1,238 @@ +@skipOnOCIS +Feature: Resharing shared files with different permissions + As a user + I want to reshare received files and folders with other users with different permissions + So that I can control the access on those files/folders by other collaborators + + Background: + Given these users have been created with default attributes: + | username | + | user1 | + | user2 | + | user3 | + + Scenario: Reshare a folder without share permissions using API and check if it is listed on the collaborators list for original owner + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has shared folder "simple-folder (2)" with user "user3" with "read" permissions + And user "user2" has logged in using the webUI + When the user opens the share dialog for folder "simple-folder" using the webUI + Then user "User Three" should be listed as "Viewer" in the collaborators list for folder "simple-folder" on the webUI + And no custom permissions should be set for collaborator "User Three" for folder "simple-folder" on the webUI + + Scenario: Reshare a folder without share permissions using API and check if it is listed on the collaborators list for resharer + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has shared folder "simple-folder (2)" with user "user3" with "read" permissions + And user "user1" has logged in using the webUI + When the user opens the share dialog for folder "simple-folder (2)" using the webUI + Then user "User Three" should be listed as "Viewer" in the collaborators list for folder "simple-folder (2)" on the webUI + And no custom permissions should be set for collaborator "User Three" for folder "simple-folder (2)" on the webUI + + Scenario: Reshare a folder without share permissions using API and check if the receiver can reshare + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has shared folder "simple-folder (2)" with user "user3" with "read" permissions + When user "user3" logs in using the webUI + Then the user should not be able to share folder "simple-folder (2)" using the webUI + + Scenario Outline: share a received folder with another user with same permissions(including share permissions) and check if the user is displayed in collaborators list for resharer + Given user "user2" has shared folder "simple-folder" with user "user1" with "" permissions + And user "user1" has logged in using the webUI + When the user shares folder "simple-folder (2)" with user "User Three" as "" with permissions "" using the webUI + Then user "User Three" should be listed as "" in the collaborators list for folder "simple-folder (2)" on the webUI + And custom permissions "" should be set for user "User Three" for folder "simple-folder (2)" on the webUI + And user "user3" should have received a share with these details: + | field | value | + | uid_owner | user1 | + | share_with | user3 | + | file_target | /simple-folder (2) | + | item_type | folder | + | permissions | | + Examples: + | role | displayed-role | collaborators-permissions | displayed-permissions | permissions | + | Viewer | Viewer | share | share | read, share | + | Editor | Editor | share | share | all | + | Advanced permissions | Advanced permissions | share, create | share, create | read, share, create | + | Advanced permissions | Advanced permissions | update, share | share, update | read, update, share | + | Advanced permissions | Editor | delete, share, create, update | share | read, share, delete, update, create | + + Scenario Outline: share a received folder with another user with same permissions(including share permissions) and check if the user is displayed in collaborators list for original owner + Given user "user2" has shared folder "simple-folder" with user "user1" with "" permissions + And user "user1" has logged in using the webUI + When the user shares folder "simple-folder (2)" with user "User Three" as "" with permissions "" using the webUI + And the user re-logs in as "user2" using the webUI + Then user "User Three" should be listed as "" in the collaborators list for folder "simple-folder" on the webUI + And custom permissions "" should be set for user "User Three" for folder "simple-folder" on the webUI + And user "User One" should be listed as "" in the collaborators list for folder "simple-folder" on the webUI + And custom permissions "" should be set for user "User One" for folder "simple-folder" on the webUI + And user "user3" should have received a share with these details: + | field | value | + | uid_owner | user1 | + | share_with | user3 | + | file_target | /simple-folder (2) | + | item_type | folder | + | permissions | | + And user "user1" should have received a share with these details: + | field | value | + | uid_owner | user2 | + | share_with | user1 | + | file_target | /simple-folder (2) | + | item_type | folder | + | permissions | | + Examples: + | role | displayed-role | collaborators-permissions | displayed-permissions | permissions | + | Viewer | Viewer | share | share | read, share | + | Editor | Editor | share | share | all | + | Advanced permissions | Advanced permissions | share, create | share, create | read, share, create | + | Advanced permissions | Advanced permissions | update, share | share, update | read, update, share | + | Advanced permissions | Editor | delete, share, create, update | share | read, share, delete, update, create | + + Scenario: share a folder with another user with share permissions and reshare without share permissions to different user, and check if user is displayed for original sharer + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has logged in using the webUI + When the user shares folder "simple-folder (2)" with user "User Three" as "Viewer" with permissions "," using the webUI + And the user re-logs in as "user2" using the webUI + Then user "User Three" should be listed as "Viewer" in the collaborators list for folder "simple-folder" on the webUI + And no custom permissions should be set for collaborator "User Three" for folder "simple-folder" on the webUI + And user "User One" should be listed as "Viewer" in the collaborators list for folder "simple-folder" on the webUI + And custom permissions "share" should be set for user "User One" for folder "simple-folder" on the webUI + And user "user1" should have received a share with these details: + | field | value | + | uid_owner | user2 | + | share_with | user1 | + | file_target | /simple-folder (2) | + | item_type | folder | + | permissions | read, share | + And user "user3" should have received a share with these details: + | field | value | + | uid_owner | user1 | + | share_with | user3 | + | file_target | /simple-folder (2) | + | item_type | folder | + | permissions | read | + + Scenario: share a folder with another user with share permissions and reshare without share permissions to different user, and check if user is displayed for the receiver + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share" permissions + And user "user1" has logged in using the webUI + When the user shares folder "simple-folder (2)" with user "User Three" as "Viewer" with permissions "," using the webUI + And user "user3" should have received a share with these details: + | field | value | + | uid_owner | user1 | + | share_with | user3 | + | file_target | /simple-folder (2) | + | item_type | folder | + | permissions | read | + + Scenario Outline: share a file/folder without share permissions and check if another user can reshare + Given user "user2" has shared folder "" with user "user1" with "read" permissions + When user "user1" logs in using the webUI + Then the user should not be able to share resource "" using the webUI + Examples: + | shared-entry-name | received-entry-name | + | simple-folder | simple-folder (2) | + | lorem.txt | lorem (2).txt | + | simple-folder | simple-folder (2) | + | lorem.txt | lorem (2).txt | + + Scenario Outline: share a received file/folder without share permissions and check if another user can reshare + Given user "user2" has shared folder "" with user "user1" with "all" permissions + And user "user1" has shared folder "" with user "user3" with "read" permissions + When user "user3" logs in using the webUI + Then the user should not be able to share resource "" using the webUI + Examples: + | shared-entry-name | received-entry-name | + | simple-folder | simple-folder (2) | + | lorem.txt | lorem (2).txt | + + Scenario: User is allowed to reshare a file/folder with the equivalent received permissions, and collaborators should not be listed for the receiver + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share, delete" permissions + And user "user1" has logged in using the webUI + When the user shares folder "simple-folder (2)" with user "User Three" as "Advanced permissions" with permissions "share, delete" using the webUI + And the user re-logs in as "user3" using the webUI + And the user opens the share dialog for folder "simple-folder (2)" using the webUI + Then the current collaborators list should have order "User Two,User Three" + And user "User Two" should be listed as "Owner" reshared through "User One" in the collaborators list on the webUI + And user "user3" should have received a share with these details: + | field | value | + | uid_owner | user1 | + | share_with | user3 | + | file_target | /simple-folder (2) | + | item_type | folder | + | permissions | share, delete, read | + + Scenario: User is allowed to reshare a file/folder with the lesser permissions, and check if it is listed for original owner + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share, delete" permissions + And user "user1" has logged in using the webUI + When the user shares folder "simple-folder (2)" with user "User Three" as "Advanced permissions" with permissions "delete" using the webUI + And the user re-logs in as "user2" using the webUI + Then user "User One" should be listed as "Advanced permissions" in the collaborators list for folder "simple-folder" on the webUI + And custom permissions "share, delete" should be set for user "User One" for folder "simple-folder" on the webUI + And user "User Three" should be listed as "Advanced permissions" in the collaborators list for folder "simple-folder" on the webUI + And custom permissions "delete" should be set for user "User Three" for folder "simple-folder" on the webUI + And user "user3" should have received a share with these details: + | field | value | + | uid_owner | user1 | + | share_with | user3 | + | file_target | /simple-folder (2) | + | item_type | folder | + | permissions | delete, read | + + Scenario: User is not allowed to reshare a file/folder with the higher permissions + Given user "user2" has shared folder "simple-folder" with user "user1" with "read, share, delete" permissions + And user "user1" has logged in using the webUI + When the user shares folder "simple-folder (2)" with user "User Three" as "Advanced permissions" with permissions "share, delete, update" using the webUI + Then the error message with header "Error while sharing." should be displayed on the webUI + And as "user3" folder "simple-folder (2)" should not exist + + Scenario: Reshare a file and folder from shared with me page + Given user "user1" has shared folder "simple-folder" with user "user2" + And user "user1" has shared file "lorem.txt" with user "user2" + And user "user2" has logged in using the webUI + And the user has browsed to the shared-with-me page + When the user shares folder "simple-folder (2)" with user "User Three" as "Editor" using the webUI + And the user shares file "lorem (2).txt" with user "User Three" as "Editor" using the webUI + Then as "user3" folder "simple-folder (2)" should exist + And as "user3" file "lorem (2).txt" should exist + + Scenario: Reshare a file and folder from shared with others page + Given user "user1" has shared folder "simple-folder" with user "user2" + And user "user1" has shared file "lorem.txt" with user "user2" + And user "user1" has logged in using the webUI + And the user has browsed to the shared-with-others page + When the user shares folder "simple-folder" with user "User Three" as "Editor" using the webUI + And the user shares file "lorem.txt" with user "User Three" as "Editor" using the webUI + Then as "user3" folder "simple-folder (2)" should exist + And as "user3" file "lorem (2).txt" should exist + + Scenario: Reshare a file and folder from favorites page + Given user "user1" has shared folder "simple-folder" with user "user2" + And user "user1" has shared file "lorem.txt" with user "user2" + And user "user2" has favorited element "simple-folder (2)" + And user "user2" has favorited element "lorem (2).txt" + And user "user2" has logged in using the webUI + When the user browses to the favorites page using the webUI + And the user shares folder "simple-folder (2)" with user "User Three" as "Editor" using the webUI + And the user shares file "lorem (2).txt" with user "User Three" as "Editor" using the webUI + Then as "user3" folder "simple-folder (2)" should exist + And as "user3" file "lorem (2).txt" should exist + + Scenario: Resource owner sees resharer in collaborators list + Given user "user3" has been created with default attributes + And user "user1" has shared folder "simple-folder" with user "user2" + And user "user2" has shared folder "simple-folder (2)" with user "user3" + When user "user1" has logged in using the webUI + And the user opens the share dialog for folder "simple-folder" using the webUI + Then user "User Two" should be listed as "Editor" in the collaborators list on the webUI + And user "User Three" should be listed as "Editor" reshared through "User Two" in the collaborators list on the webUI + + Scenario: Share recipient sees resharer in collaborators list + Given user "user3" has been created with default attributes + And user "user4" has been created with default attributes + And group "user4grp" has been created + And user "user4" has been added to group "user4grp" + And user "user1" has shared folder "simple-folder" with user "user2" + And user "user1" has shared folder "simple-folder" with user "user3" + And user "user2" has shared folder "simple-folder (2)" with user "user4" + And user "user3" has shared folder "simple-folder (2)" with group "user4grp" + When user "user4" has logged in using the webUI + And the user opens the share dialog for folder "simple-folder (2)" using the webUI + Then user "User One" should be listed as "Owner" reshared through "User Three, User Two" in the collaborators list on the webUI + diff --git a/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature b/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature index ac05f558b8c..30256553e29 100644 --- a/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature +++ b/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature @@ -1,11 +1,13 @@ -@skipOnOCIS @ocis-reva-issue-64 +@skip\ @issue-4102OnOCIS @ocis-reva-issue-64 Feature: accept/decline shares coming from internal users As a user I want to have control of which received shares I accept So that I can keep my file system clean Background: - Given these users have been created with default attributes: + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And the administrator has set the default folder for received shares to "Shares" + And these users have been created with default attributes: | username | | user1 | | user2 | @@ -23,9 +25,9 @@ Feature: accept/decline shares coming from internal users When the user declines share "simple-folder" offered by user "User One" using the webUI Then folder "simple-folder" shared by "User One" should be in "Declined" state on the webUI When the user browses to the files page - Then folder "simple-folder (2)" should not be listed on the webUI + Then folder "/Shares" should not be listed on the webUI - @issue-2512 + @issue-2512 @skip @issue-4102 Scenario: reshare a share that you received to a group that you are member of Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" And these groups have been created: @@ -35,14 +37,15 @@ Feature: accept/decline shares coming from internal users And user "user1" has shared folder "/simple-folder" with user "user2" And user "user2" has accepted the share "simple-folder" offered by user "user1" And the user has browsed to the files page - When the user shares folder "simple-folder (2)" with group "grp1" as "Viewer" using the webUI - And the user unshares folder "simple-folder (2)" using the webUI + And the user opens folder "Shares" using the webUI + When the user shares folder "simple-folder" with group "grp1" as "Viewer" using the webUI + And the user unshares folder "simple-folder" using the webUI And the user browses to the shared-with-me page using the webUI - Then folder "simple-folder (2)" shared by "User One" should be in "Declined" state on the webUI + Then folder "simple-folder" shared by "User One" should be in "Declined" state on the webUI And folder "simple-folder" shared by "User Two" should not be listed in the webUI And folder "simple-folder" should not be listed on the webUI - @smokeTest + @smokeTest @skip @issue-4102 Scenario: unshare an accepted share on the "All files" page Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" And these groups have been created: @@ -54,129 +57,14 @@ Feature: accept/decline shares coming from internal users And user "user2" has accepted the share "simple-folder" offered by user "user1" And user "user2" has accepted the share "testimage.jpg" offered by user "user1" And the user has browsed to the files page - When the user unshares folder "simple-folder (2)" using the webUI - And the user unshares file "testimage (2).jpg" using the webUI - Then folder "simple-folder (2)" should not be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI + When the user opens folder "Shares" using the webUI + And the user unshares folder "simple-folder" using the webUI + And the user unshares file "testimage.jpg" using the webUI + Then folder "simple-folder" should not be listed on the webUI + And file "testimage.jpg" should not be listed on the webUI When the user browses to the shared-with-me page using the webUI - Then folder "simple-folder (2)" shared by "User One" should be in "Declined" state on the webUI - And file "testimage (2).jpg" shared by "User One" should be in "Declined" state on the webUI - - @smokeTest - Scenario: Auto-accept shares - Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" - And these groups have been created: - | groupname | - | grp1 | - And user "user2" has been added to group "grp1" - And user "user1" has shared folder "/simple-folder" with group "grp1" - And user "user1" has shared folder "/testimage.jpg" with user "user2" - When the user browses to the files page - Then folder "simple-folder (2)" should be listed on the webUI - And file "testimage (2).jpg" should be listed on the webUI - When the user browses to the shared-with-me page using the webUI - Then folder "simple-folder (2)" shared by "User One" should be in "Accepted" state on the webUI - And file "testimage (2).jpg" shared by "User One" should be in "Accepted" state on the webUI - - Scenario: decline auto-accepted shares - Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" - And these groups have been created: - | groupname | - | grp1 | - And user "user2" has been added to group "grp1" - And user "user1" has shared folder "/simple-folder" with group "grp1" - And user "user1" has shared folder "/testimage.jpg" with user "user2" - And the user has browsed to the files page - When the user deletes folder "simple-folder (2)" using the webUI - And the user deletes file "testimage (2).jpg" using the webUI - Then folder "simple-folder (2)" should not be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI - When the user browses to the shared-with-me page using the webUI - Then folder "simple-folder (2)" shared by "User One" should be in "Declined" state on the webUI - And file "testimage (2).jpg" shared by "User One" should be in "Declined" state on the webUI - - Scenario: unshare auto-accepted shares - Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" - And these groups have been created: - | groupname | - | grp1 | - And user "user2" has been added to group "grp1" - And user "user1" has shared folder "/simple-folder" with group "grp1" - And user "user1" has shared folder "/testimage.jpg" with user "user2" - And the user has browsed to the shared-with-me page - When the user unshares folder "simple-folder (2)" using the webUI - And the user unshares file "testimage (2).jpg" using the webUI - And the user browses to the files page - Then folder "simple-folder (2)" should not be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI - When the user browses to the shared-with-me page using the webUI - Then folder "simple-folder (2)" shared by "User One" should be in "Declined" state on the webUI - And file "testimage (2).jpg" shared by "User One" should be in "Declined" state on the webUI - - Scenario: unshare renamed shares - Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" - And user "user1" has shared folder "simple-folder" with user "user2" with "create, read, share, update" permissions - And user "user2" has renamed folder "simple-folder (2)" to "simple-folder-renamed" - And the user has reloaded the current page of the webUI - When the user unshares folder "simple-folder-renamed" using the webUI - Then folder "simple-folder-renamed" should not be listed on the webUI - When the user browses to the shared-with-me page using the webUI - Then folder "simple-folder-renamed" shared by "User One" should be in "Declined" state on the webUI - - Scenario: unshare moved shares - Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" - And user "user1" has shared folder "simple-folder" with user "user2" with "create, read, share, update" permissions - And user "user2" has moved folder "/simple-folder (2)" to "/simple-folder/shared" - And the user has reloaded the current page of the webUI - When the user opens folder "simple-folder" using the webUI - And the user unshares folder "shared" using the webUI - Then folder "shared" should not be listed on the webUI - When the user browses to the shared-with-me page using the webUI - Then folder "shared" shared by "User One" should be in "Declined" state on the webUI - - Scenario: unshare renamed shares, accept it again - Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" - And user "user1" has shared folder "/simple-folder" with user "user2" - And user "user2" has renamed folder "/simple-folder (2)" to "/simple-folder-renamed" - And the user has reloaded the current page of the webUI - When the user unshares folder "simple-folder-renamed" using the webUI - And the user browses to the shared-with-me page using the webUI - And the user accepts share "simple-folder-renamed" offered by user "User One" using the webUI - Then folder "simple-folder-renamed" shared by "User One" should be in "Accepted" state on the webUI - When the user browses to the files page - Then folder "simple-folder-renamed" should be listed on the webUI - - @skip @yetToImplement - Scenario: User-based accepting is disabled while global is enabled - Given the setting "Automatically accept new incoming local user shares" in the section "Sharing" has been enabled - And user "user1" has logged in using the webUI - And the user has browsed to the personal sharing settings page - When the user disables automatically accepting new incoming local shares - And user "user2" shares folder "/simple-folder" with group "grp1" using the sharing API - And user "user2" shares file "/testimage.jpg" with user "user1" using the sharing API - And the user browses to the files page - Then folder "simple-folder (2)" should not be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI - But folder "simple-folder" should be listed in the shared-with-you page on the webUI - And file "testimage.jpg" should be listed in the shared-with-you page on the webUI - And folder "simple-folder" should be in state "Pending" in the shared-with-you page on the webUI - And file "testimage.jpg" should be in state "Pending" in the shared-with-you page on the webUI - - @skip @yetToImplement - Scenario: User-based accepting is enabled while global is enabled - Given the setting "Automatically accept new incoming local user shares" in the section "Sharing" has been enabled - And user "user1" has logged in using the webUI - And the user has browsed to the personal sharing settings page - When the user enables automatically accepting new incoming local shares - And user "user2" shares folder "/simple-folder" with group "grp1" using the sharing API - And user "user2" shares file "/testimage.jpg" with user "user1" using the sharing API - And the user browses to the files page - Then folder "simple-folder (2)" should be listed on the webUI - And file "testimage (2).jpg" should be listed on the webUI - And folder "simple-folder (2)" should be listed in the shared-with-you page on the webUI - And file "testimage (2).jpg" should be listed in the shared-with-you page on the webUI - And folder "simple-folder (2)" should be in state "" in the shared-with-you page on the webUI - And file "testimage (2).jpg" should be in state "" in the shared-with-you page on the webUI + Then folder "simple-folder" shared by "User One" should be in "Declined" state on the webUI + And file "testimage.jpg" shared by "User One" should be in "Declined" state on the webUI @skip @yetToImplement Scenario: User-based accepting checkbox is not visible while global is disabled @@ -185,31 +73,14 @@ Feature: accept/decline shares coming from internal users And the user has browsed to the personal sharing settings page Then User-based auto accepting checkbox should not be displayed on the personal sharing settings page in the webUI - @skip @yetToImplement - Scenario: Admin disables auto-accept setting again after user enabled personal auto-accept setting - Given the setting "Automatically accept new incoming local user shares" in the section "Sharing" has been enabled - And user "user1" has logged in using the webUI - And the user has browsed to the personal sharing settings page - When the user disables automatically accepting new incoming local shares - And the user enables automatically accepting new incoming local shares - And the administrator disables the setting "Automatically accept new incoming local user shares" in the section "Sharing" - And user "user2" shares folder "/simple-folder" with group "grp1" using the sharing API - And user "user2" shares file "/testimage.jpg" with user "user1" using the sharing API - And the user browses to the files page - Then folder "simple-folder (2)" should not be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI - And folder "simple-folder" should be listed in the shared-with-you page on the webUI - And file "testimage.jpg" should be listed in the shared-with-you page on the webUI - And folder "simple-folder" should be in state "Pending" in the shared-with-you page on the webUI - And file "testimage.jpg" should be in state "Pending" in the shared-with-you page on the webUI - Scenario: User receives files when auto accept share is disabled Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" And user "user1" has shared file "lorem.txt" with user "user2" When the user browses to the shared-with-me page using the webUI Then file "lorem.txt" shared by "User One" should be in "Pending" state on the webUI When the user browses to the files page - Then file "lorem (2).txt" should not be listed on the webUI + Then file "lorem.txt" should not be listed on the webUI + And folder "Shares" should not be listed on the webUI Scenario: shared file is in pending state when the Automatically accept incoming shares is disabled Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" @@ -217,7 +88,8 @@ Feature: accept/decline shares coming from internal users When the user browses to the shared-with-me page using the webUI Then file "lorem.txt" shared by "User One" should be in "Pending" state on the webUI When the user browses to the files page - Then file "lorem (2).txt" should not be listed on the webUI + Then file "lorem.txt" should not be listed on the webUI + And folder "Shares" should not be listed on the webUI Scenario: receive shares with same name from different users Given user "user3" has been created with default attributes @@ -237,8 +109,8 @@ Feature: accept/decline shares coming from internal users Then file "lorem.txt" shared by "User One" should be in "Declined" state on the webUI And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI When the user browses to the files page - Then file "lorem (2).txt" should not be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI + Then file "lorem.txt" should not be listed on the webUI + And file "testimage.jpg" should not be listed on the webUI Scenario: accept an offered (pending) share Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" @@ -246,13 +118,14 @@ Feature: accept/decline shares coming from internal users And user "user1" has shared file "testimage.jpg" with user "user2" And the user has browsed to the shared-with-me page When the user accepts share "lorem.txt" offered by user "User One" using the webUI - Then file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI + Then file "lorem.txt" shared by "User One" should be in "Accepted" state on the webUI And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI - And the file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI after a page reload + And the file "lorem.txt" shared by "User One" should be in "Accepted" state on the webUI after a page reload And the file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI after a page reload When the user browses to the files page - Then file "lorem (2).txt" should be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI + And the user opens folder "Shares" using the webUI + Then file "lorem.txt" should be listed on the webUI + And file "testimage.jpg" should not be listed on the webUI Scenario: accept a previously declined share Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" @@ -261,12 +134,14 @@ Feature: accept/decline shares coming from internal users And user "user2" has declined the share "lorem.txt" offered by user "user1" And the user has browsed to the shared-with-me page When the user accepts share "lorem.txt" offered by user "User One" using the webUI - Then file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI + Then file "lorem.txt" shared by "User One" should be in "Accepted" state on the webUI And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI When the user browses to the files page - Then file "lorem (2).txt" should be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI + And the user opens folder "Shares" using the webUI + Then file "lorem.txt" should be listed on the webUI + And file "testimage.jpg" should not be listed on the webUI + @skip @issue-4102 Scenario: delete an accepted share Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" And user "user1" has shared file "lorem.txt" with user "user2" @@ -274,14 +149,15 @@ Feature: accept/decline shares coming from internal users And the user has browsed to the shared-with-me page When the user accepts share "lorem.txt" offered by user "User One" using the webUI And the user browses to the files page - And the user deletes file "lorem (2).txt" using the webUI - Then file "lorem (2).txt" should not be listed on the webUI - And file "testimage (2).jpg" should not be listed on the webUI + And the user opens folder "Shares" using the webUI + And the user deletes file "lorem.txt" using the webUI + Then file "lorem.txt" should not be listed on the webUI + And file "testimage.jpg" should not be listed on the webUI When the user browses to the shared-with-me page using the webUI - Then file "lorem (2).txt" shared by "User One" should be in "Declined" state on the webUI + Then file "lorem.txt" shared by "User One" should be in "Declined" state on the webUI And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI - @issue-3101 @skip + @issue-3101 @skip @issue-4102 Scenario: Delete multiple accepted shares at once from shared with me page Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" And user "user1" has been created with default attributes @@ -293,33 +169,38 @@ Feature: accept/decline shares coming from internal users When the user batch deletes these files using the webUI | name | | data.zip | - | lorem (2).txt | + | lorem.txt | | simple-folder | Then file "data.zip" should not be listed on the webUI - And file "lorem (2).txt" should not be listed on the webUI + And file "lorem.txt" should not be listed on the webUI And folder "simple-folder" should not be listed on the webUI When the user has reloaded the current page of the webUI Then file "data.zip" shared by "User One" should be in "Declined" state on the webUI - And file "lorem (2).txt" shared by "User One" should be in "Declined" state on the webUI + And file "lorem.txt" shared by "User One" should be in "Declined" state on the webUI And folder "simple-folder" shared by "User One" should be in "Declined" state on the webUI + @skip @issue-4102 Scenario: shared file status is changed to declined when user deletes the file Given user "user1" has shared file "lorem.txt" with user "user2" + And user "user2" has accepted the share "lorem.txt" offered by user "user1" And the user has reloaded the current page of the webUI - When the user deletes file "lorem (2).txt" using the webUI + And the user opens folder "Shares" using the webUI + When the user deletes file "lorem.txt" using the webUI And the user browses to the shared-with-me page - Then file "lorem (2).txt" shared by "User One" should be in "Declined" state on the webUI + Then file "lorem.txt" shared by "User One" should be in "Declined" state on the webUI Scenario: the deleted shared file is restored back to all files list when accepted from the shared with me file list Given user "user1" has shared file "lorem.txt" with user "user2" + And user "user2" has accepted the share "lorem.txt" offered by user "user1" And the following files have been deleted by user "user2" | name | - | lorem (2).txt | + | Shares/lorem.txt | And the user has browsed to the shared-with-me page - When the user accepts share "lorem (2).txt" offered by user "User One" using the webUI - Then the file "lorem (2).txt" shared by "User One" should not be in "Declined" state + When the user accepts share "lorem.txt" offered by user "User One" using the webUI + Then the file "lorem.txt" shared by "User One" should not be in "Declined" state When the user browses to the files page - Then file "lorem (2).txt" should be listed on the webUI + And the user opens folder "Shares" using the webUI + Then file "lorem.txt" should be listed on the webUI Scenario: receive shares with same name from different users, accept one by one Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" @@ -330,11 +211,11 @@ Feature: accept/decline shares coming from internal users And user "user1" has shared folder "/simple-folder" with user "user2" And the user has browsed to the shared-with-me page When the user accepts share "simple-folder" offered by user "User One" using the webUI - Then folder "simple-folder (2)" shared by "User One" should be in "Accepted" state on the webUI + Then folder "simple-folder" shared by "User One" should be in "Accepted" state on the webUI When the user accepts share "simple-folder" offered by user "User Three" using the webUI - Then folder "simple-folder (3)" shared by "User Three" should be in "Accepted" state on the webUI - And as "user2" file "from_user1" should exist inside folder "/simple-folder (2)" - And as "user2" file "from_user3" should exist inside folder "/simple-folder (3)" + Then folder "simple-folder (2)" shared by "User Three" should be in "Accepted" state on the webUI + And as "user2" file "from_user1" should exist inside folder "/Shares/simple-folder" + And as "user2" file "from_user3" should exist inside folder "/Shares/simple-folder (2)" Scenario: accept a share that you received as user and as group member Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" @@ -346,6 +227,7 @@ Feature: accept/decline shares coming from internal users And user "user1" has shared folder "/simple-folder" with group "grp1" And the user has browsed to the shared-with-me page When the user accepts share "simple-folder" offered by user "User One" using the webUI - Then folder "simple-folder (2)" shared by "User One" should be in "Accepted" state on the webUI + Then folder "simple-folder" shared by "User One" should be in "Accepted" state on the webUI When the user browses to the files page - Then folder "simple-folder (2)" should be listed on the webUI + And the user opens folder "Shares" using the webUI + Then folder "simple-folder" should be listed on the webUI diff --git a/tests/acceptance/features/webUISharingAcceptSharesToRoot/acceptShares.feature b/tests/acceptance/features/webUISharingAcceptSharesToRoot/acceptShares.feature new file mode 100644 index 00000000000..ac05f558b8c --- /dev/null +++ b/tests/acceptance/features/webUISharingAcceptSharesToRoot/acceptShares.feature @@ -0,0 +1,351 @@ +@skipOnOCIS @ocis-reva-issue-64 +Feature: accept/decline shares coming from internal users + As a user + I want to have control of which received shares I accept + So that I can keep my file system clean + + Background: + Given these users have been created with default attributes: + | username | + | user1 | + | user2 | + And user "user2" has logged in using the webUI + + Scenario: reject a share that you received as user and as group member + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And these groups have been created: + | groupname | + | grp1 | + And user "user2" has been added to group "grp1" + And user "user1" has shared folder "/simple-folder" with user "user2" + And user "user1" has shared folder "/simple-folder" with group "grp1" + And the user has browsed to the shared-with-me page + When the user declines share "simple-folder" offered by user "User One" using the webUI + Then folder "simple-folder" shared by "User One" should be in "Declined" state on the webUI + When the user browses to the files page + Then folder "simple-folder (2)" should not be listed on the webUI + + @issue-2512 + Scenario: reshare a share that you received to a group that you are member of + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And these groups have been created: + | groupname | + | grp1 | + And user "user2" has been added to group "grp1" + And user "user1" has shared folder "/simple-folder" with user "user2" + And user "user2" has accepted the share "simple-folder" offered by user "user1" + And the user has browsed to the files page + When the user shares folder "simple-folder (2)" with group "grp1" as "Viewer" using the webUI + And the user unshares folder "simple-folder (2)" using the webUI + And the user browses to the shared-with-me page using the webUI + Then folder "simple-folder (2)" shared by "User One" should be in "Declined" state on the webUI + And folder "simple-folder" shared by "User Two" should not be listed in the webUI + And folder "simple-folder" should not be listed on the webUI + + @smokeTest + Scenario: unshare an accepted share on the "All files" page + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And these groups have been created: + | groupname | + | grp1 | + And user "user2" has been added to group "grp1" + And user "user1" has shared folder "/simple-folder" with user "user2" + And user "user1" has shared folder "/testimage.jpg" with group "grp1" + And user "user2" has accepted the share "simple-folder" offered by user "user1" + And user "user2" has accepted the share "testimage.jpg" offered by user "user1" + And the user has browsed to the files page + When the user unshares folder "simple-folder (2)" using the webUI + And the user unshares file "testimage (2).jpg" using the webUI + Then folder "simple-folder (2)" should not be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + When the user browses to the shared-with-me page using the webUI + Then folder "simple-folder (2)" shared by "User One" should be in "Declined" state on the webUI + And file "testimage (2).jpg" shared by "User One" should be in "Declined" state on the webUI + + @smokeTest + Scenario: Auto-accept shares + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" + And these groups have been created: + | groupname | + | grp1 | + And user "user2" has been added to group "grp1" + And user "user1" has shared folder "/simple-folder" with group "grp1" + And user "user1" has shared folder "/testimage.jpg" with user "user2" + When the user browses to the files page + Then folder "simple-folder (2)" should be listed on the webUI + And file "testimage (2).jpg" should be listed on the webUI + When the user browses to the shared-with-me page using the webUI + Then folder "simple-folder (2)" shared by "User One" should be in "Accepted" state on the webUI + And file "testimage (2).jpg" shared by "User One" should be in "Accepted" state on the webUI + + Scenario: decline auto-accepted shares + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" + And these groups have been created: + | groupname | + | grp1 | + And user "user2" has been added to group "grp1" + And user "user1" has shared folder "/simple-folder" with group "grp1" + And user "user1" has shared folder "/testimage.jpg" with user "user2" + And the user has browsed to the files page + When the user deletes folder "simple-folder (2)" using the webUI + And the user deletes file "testimage (2).jpg" using the webUI + Then folder "simple-folder (2)" should not be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + When the user browses to the shared-with-me page using the webUI + Then folder "simple-folder (2)" shared by "User One" should be in "Declined" state on the webUI + And file "testimage (2).jpg" shared by "User One" should be in "Declined" state on the webUI + + Scenario: unshare auto-accepted shares + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" + And these groups have been created: + | groupname | + | grp1 | + And user "user2" has been added to group "grp1" + And user "user1" has shared folder "/simple-folder" with group "grp1" + And user "user1" has shared folder "/testimage.jpg" with user "user2" + And the user has browsed to the shared-with-me page + When the user unshares folder "simple-folder (2)" using the webUI + And the user unshares file "testimage (2).jpg" using the webUI + And the user browses to the files page + Then folder "simple-folder (2)" should not be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + When the user browses to the shared-with-me page using the webUI + Then folder "simple-folder (2)" shared by "User One" should be in "Declined" state on the webUI + And file "testimage (2).jpg" shared by "User One" should be in "Declined" state on the webUI + + Scenario: unshare renamed shares + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" + And user "user1" has shared folder "simple-folder" with user "user2" with "create, read, share, update" permissions + And user "user2" has renamed folder "simple-folder (2)" to "simple-folder-renamed" + And the user has reloaded the current page of the webUI + When the user unshares folder "simple-folder-renamed" using the webUI + Then folder "simple-folder-renamed" should not be listed on the webUI + When the user browses to the shared-with-me page using the webUI + Then folder "simple-folder-renamed" shared by "User One" should be in "Declined" state on the webUI + + Scenario: unshare moved shares + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" + And user "user1" has shared folder "simple-folder" with user "user2" with "create, read, share, update" permissions + And user "user2" has moved folder "/simple-folder (2)" to "/simple-folder/shared" + And the user has reloaded the current page of the webUI + When the user opens folder "simple-folder" using the webUI + And the user unshares folder "shared" using the webUI + Then folder "shared" should not be listed on the webUI + When the user browses to the shared-with-me page using the webUI + Then folder "shared" shared by "User One" should be in "Declined" state on the webUI + + Scenario: unshare renamed shares, accept it again + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes" + And user "user1" has shared folder "/simple-folder" with user "user2" + And user "user2" has renamed folder "/simple-folder (2)" to "/simple-folder-renamed" + And the user has reloaded the current page of the webUI + When the user unshares folder "simple-folder-renamed" using the webUI + And the user browses to the shared-with-me page using the webUI + And the user accepts share "simple-folder-renamed" offered by user "User One" using the webUI + Then folder "simple-folder-renamed" shared by "User One" should be in "Accepted" state on the webUI + When the user browses to the files page + Then folder "simple-folder-renamed" should be listed on the webUI + + @skip @yetToImplement + Scenario: User-based accepting is disabled while global is enabled + Given the setting "Automatically accept new incoming local user shares" in the section "Sharing" has been enabled + And user "user1" has logged in using the webUI + And the user has browsed to the personal sharing settings page + When the user disables automatically accepting new incoming local shares + And user "user2" shares folder "/simple-folder" with group "grp1" using the sharing API + And user "user2" shares file "/testimage.jpg" with user "user1" using the sharing API + And the user browses to the files page + Then folder "simple-folder (2)" should not be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + But folder "simple-folder" should be listed in the shared-with-you page on the webUI + And file "testimage.jpg" should be listed in the shared-with-you page on the webUI + And folder "simple-folder" should be in state "Pending" in the shared-with-you page on the webUI + And file "testimage.jpg" should be in state "Pending" in the shared-with-you page on the webUI + + @skip @yetToImplement + Scenario: User-based accepting is enabled while global is enabled + Given the setting "Automatically accept new incoming local user shares" in the section "Sharing" has been enabled + And user "user1" has logged in using the webUI + And the user has browsed to the personal sharing settings page + When the user enables automatically accepting new incoming local shares + And user "user2" shares folder "/simple-folder" with group "grp1" using the sharing API + And user "user2" shares file "/testimage.jpg" with user "user1" using the sharing API + And the user browses to the files page + Then folder "simple-folder (2)" should be listed on the webUI + And file "testimage (2).jpg" should be listed on the webUI + And folder "simple-folder (2)" should be listed in the shared-with-you page on the webUI + And file "testimage (2).jpg" should be listed in the shared-with-you page on the webUI + And folder "simple-folder (2)" should be in state "" in the shared-with-you page on the webUI + And file "testimage (2).jpg" should be in state "" in the shared-with-you page on the webUI + + @skip @yetToImplement + Scenario: User-based accepting checkbox is not visible while global is disabled + Given the setting "Automatically accept new incoming local user shares" in the section "Sharing" has been disabled + And user "user1" has logged in using the webUI + And the user has browsed to the personal sharing settings page + Then User-based auto accepting checkbox should not be displayed on the personal sharing settings page in the webUI + + @skip @yetToImplement + Scenario: Admin disables auto-accept setting again after user enabled personal auto-accept setting + Given the setting "Automatically accept new incoming local user shares" in the section "Sharing" has been enabled + And user "user1" has logged in using the webUI + And the user has browsed to the personal sharing settings page + When the user disables automatically accepting new incoming local shares + And the user enables automatically accepting new incoming local shares + And the administrator disables the setting "Automatically accept new incoming local user shares" in the section "Sharing" + And user "user2" shares folder "/simple-folder" with group "grp1" using the sharing API + And user "user2" shares file "/testimage.jpg" with user "user1" using the sharing API + And the user browses to the files page + Then folder "simple-folder (2)" should not be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + And folder "simple-folder" should be listed in the shared-with-you page on the webUI + And file "testimage.jpg" should be listed in the shared-with-you page on the webUI + And folder "simple-folder" should be in state "Pending" in the shared-with-you page on the webUI + And file "testimage.jpg" should be in state "Pending" in the shared-with-you page on the webUI + + Scenario: User receives files when auto accept share is disabled + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user1" has shared file "lorem.txt" with user "user2" + When the user browses to the shared-with-me page using the webUI + Then file "lorem.txt" shared by "User One" should be in "Pending" state on the webUI + When the user browses to the files page + Then file "lorem (2).txt" should not be listed on the webUI + + Scenario: shared file is in pending state when the Automatically accept incoming shares is disabled + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user1" has shared file "lorem.txt" with user "user2" + When the user browses to the shared-with-me page using the webUI + Then file "lorem.txt" shared by "User One" should be in "Pending" state on the webUI + When the user browses to the files page + Then file "lorem (2).txt" should not be listed on the webUI + + Scenario: receive shares with same name from different users + Given user "user3" has been created with default attributes + And the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user3" has shared file "lorem.txt" with user "user2" + And user "user1" has shared file "lorem.txt" with user "user2" + When the user browses to the shared-with-me page using the webUI + Then file "lorem.txt" shared by "User One" should be in "Pending" state on the webUI + And file "lorem.txt" shared by "User Three" should be in "Pending" state on the webUI + + Scenario: decline an offered (pending) share + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user1" has shared file "lorem.txt" with user "user2" + And user "user1" has shared file "testimage.jpg" with user "user2" + And the user has browsed to the shared-with-me page + When the user declines share "lorem.txt" offered by user "User One" using the webUI + Then file "lorem.txt" shared by "User One" should be in "Declined" state on the webUI + And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI + When the user browses to the files page + Then file "lorem (2).txt" should not be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + + Scenario: accept an offered (pending) share + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user1" has shared file "lorem.txt" with user "user2" + And user "user1" has shared file "testimage.jpg" with user "user2" + And the user has browsed to the shared-with-me page + When the user accepts share "lorem.txt" offered by user "User One" using the webUI + Then file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI + And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI + And the file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI after a page reload + And the file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI after a page reload + When the user browses to the files page + Then file "lorem (2).txt" should be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + + Scenario: accept a previously declined share + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user1" has shared file "lorem.txt" with user "user2" + And user "user1" has shared file "testimage.jpg" with user "user2" + And user "user2" has declined the share "lorem.txt" offered by user "user1" + And the user has browsed to the shared-with-me page + When the user accepts share "lorem.txt" offered by user "User One" using the webUI + Then file "lorem (2).txt" shared by "User One" should be in "Accepted" state on the webUI + And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI + When the user browses to the files page + Then file "lorem (2).txt" should be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + + Scenario: delete an accepted share + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user1" has shared file "lorem.txt" with user "user2" + And user "user1" has shared file "testimage.jpg" with user "user2" + And the user has browsed to the shared-with-me page + When the user accepts share "lorem.txt" offered by user "User One" using the webUI + And the user browses to the files page + And the user deletes file "lorem (2).txt" using the webUI + Then file "lorem (2).txt" should not be listed on the webUI + And file "testimage (2).jpg" should not be listed on the webUI + When the user browses to the shared-with-me page using the webUI + Then file "lorem (2).txt" shared by "User One" should be in "Declined" state on the webUI + And file "testimage.jpg" shared by "User One" should be in "Pending" state on the webUI + + @issue-3101 @skip + Scenario: Delete multiple accepted shares at once from shared with me page + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user1" has been created with default attributes + And user "user1" has shared folder "simple-folder" with user "user2" + And user "user1" has shared file "lorem.txt" with user "user2" + And user "user1" has shared file "data.zip" with user "user2" + And the user has browsed to the shared-with-me page + And the user accepts share "lorem.txt" offered by user "User One" using the webUI + When the user batch deletes these files using the webUI + | name | + | data.zip | + | lorem (2).txt | + | simple-folder | + Then file "data.zip" should not be listed on the webUI + And file "lorem (2).txt" should not be listed on the webUI + And folder "simple-folder" should not be listed on the webUI + When the user has reloaded the current page of the webUI + Then file "data.zip" shared by "User One" should be in "Declined" state on the webUI + And file "lorem (2).txt" shared by "User One" should be in "Declined" state on the webUI + And folder "simple-folder" shared by "User One" should be in "Declined" state on the webUI + + Scenario: shared file status is changed to declined when user deletes the file + Given user "user1" has shared file "lorem.txt" with user "user2" + And the user has reloaded the current page of the webUI + When the user deletes file "lorem (2).txt" using the webUI + And the user browses to the shared-with-me page + Then file "lorem (2).txt" shared by "User One" should be in "Declined" state on the webUI + + Scenario: the deleted shared file is restored back to all files list when accepted from the shared with me file list + Given user "user1" has shared file "lorem.txt" with user "user2" + And the following files have been deleted by user "user2" + | name | + | lorem (2).txt | + And the user has browsed to the shared-with-me page + When the user accepts share "lorem (2).txt" offered by user "User One" using the webUI + Then the file "lorem (2).txt" shared by "User One" should not be in "Declined" state + When the user browses to the files page + Then file "lorem (2).txt" should be listed on the webUI + + Scenario: receive shares with same name from different users, accept one by one + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And user "user3" has been created with default attributes + And user "user3" has created folder "/simple-folder/from_user3" + And user "user3" has shared folder "/simple-folder" with user "user2" + And user "user1" has created folder "/simple-folder/from_user1" + And user "user1" has shared folder "/simple-folder" with user "user2" + And the user has browsed to the shared-with-me page + When the user accepts share "simple-folder" offered by user "User One" using the webUI + Then folder "simple-folder (2)" shared by "User One" should be in "Accepted" state on the webUI + When the user accepts share "simple-folder" offered by user "User Three" using the webUI + Then folder "simple-folder (3)" shared by "User Three" should be in "Accepted" state on the webUI + And as "user2" file "from_user1" should exist inside folder "/simple-folder (2)" + And as "user2" file "from_user3" should exist inside folder "/simple-folder (3)" + + Scenario: accept a share that you received as user and as group member + Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no" + And these groups have been created: + | groupname | + | grp1 | + And user "user2" has been added to group "grp1" + And user "user1" has shared folder "/simple-folder" with user "user2" + And user "user1" has shared folder "/simple-folder" with group "grp1" + And the user has browsed to the shared-with-me page + When the user accepts share "simple-folder" offered by user "User One" using the webUI + Then folder "simple-folder (2)" shared by "User One" should be in "Accepted" state on the webUI + When the user browses to the files page + Then folder "simple-folder (2)" should be listed on the webUI diff --git a/tests/acceptance/helpers/sharingHelper.js b/tests/acceptance/helpers/sharingHelper.js index 90e314401d7..e86c70eef1f 100644 --- a/tests/acceptance/helpers/sharingHelper.js +++ b/tests/acceptance/helpers/sharingHelper.js @@ -76,6 +76,21 @@ module.exports = { } return dateString }, + assertUserHasNoShares: function(user) { + const apiURL = 'apps/files_sharing/api/v1/shares?' + return httpHelper + .getOCS(apiURL, user) + .then(res => res.json()) + .then(function(sharesResult) { + httpHelper.checkOCSStatus( + sharesResult, + 'Could not get shares. Message: ' + sharesResult.ocs.meta.message + ) + const shares = sharesResult.ocs.data + assert.equal(0, shares.length) + return this + }) + }, /** * * @param {string } user diff --git a/tests/acceptance/stepDefinitions/sharingContext.js b/tests/acceptance/stepDefinitions/sharingContext.js index 5c923cd15e0..20e2221085c 100644 --- a/tests/acceptance/stepDefinitions/sharingContext.js +++ b/tests/acceptance/stepDefinitions/sharingContext.js @@ -1081,6 +1081,10 @@ Then('user {string} should have received a share with these details:', function( }) }) +Then('user {string} should not have received any shares', function(user) { + return sharingHelper.assertUserHasNoShares(user) +}) + Given('user {string} has created a new public link for resource {string}', function( user, resource @@ -1245,6 +1249,14 @@ Given('user {string} has accepted the share {string} offered by user {code}', fu return sharingHelper.acceptShare(filename, user, sharer) }) +Given('user {string} accepts the share {string} offered by user {code}', function( + user, + filename, + sharer +) { + return sharingHelper.acceptShare(filename, user, sharer) +}) + Then('the file {string} shared by {string} should not be in {string} state', async function( filename, sharer, @@ -1375,3 +1387,15 @@ When( ) } ) + +Given('the administrator has set the default folder for received shares to {string}', function( + folder +) { + if (client.globals.ocis) { + if (folder === 'Shares') { + return + } + throw Error(`Cannot set ${folder} as default share received folder in OCIS`) + } + return runOcc([`config:system:set share_folder --value=${folder}`]) +})