From ebdcd2fd8e8dddc5682977797f8b251935ca9241 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Fri, 23 Feb 2024 11:31:31 +0545 Subject: [PATCH] add tests to list peoject spaces resources shared by two users with him/her --- .../sharedWithMeSyncDisabled.feature | 514 ++++++++++++++++++ 1 file changed, 514 insertions(+) diff --git a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature index 08d28336f3a..3b9e37a86ca 100644 --- a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature +++ b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature @@ -2794,3 +2794,517 @@ Feature: listing sharedWithMe when auto-sync is disabled } } """ + + + Scenario: user lists the file with same name shared by two users with him/her from project-space + Given using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "projectSpace1" with the default quota using the Graph API + And user "Alice" has created a space "projectSpace2" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "projectSpace1" with content "to share" to "textfile.txt" + And user "Alice" has sent the following share invitation: + | resource | textfile.txt | + | space | projectSpace1 | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + And user "Alice" has uploaded a file inside space "projectSpace2" with content "to share" to "textfile.txt" + And user "Alice" has sent the following share invitation: + | resource | textfile.txt | + | space | projectSpace2 | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + When user "Brian" lists the shares shared with him using the Graph API + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": ["value"], + "properties": { + "value": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { + "type": "boolean", + "enum": [false] + }, + "@client.synchronize": { + "type": "boolean", + "enum": [false] + }, + "name": { + "type": "string", + "enum": ["textfile.txt"] + }, + "remoteItem": { + "type": "object", + "required": [ + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "permissions" + ], + "properties": { + "name": { + "type": "string", + "enum": ["textfile.txt"] + }, + "permissions": { + "type": "array", + "items": [ + { + "type": "object", + "required": ["grantedToV2", "id", "invitation", "roles"], + "properties": { + "grantedToV2": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Brian Murphy"] + } + } + } + } + } + }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Alice Hansen"] + } + } + } + } + } + } + } + } + ] + } + } + } + } + }, + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { + "type": "boolean", + "enum": [false] + }, + "@client.synchronize": { + "type": "boolean", + "enum": [false] + }, + "name": { + "type": "string", + "enum": ["textfile.txt"] + }, + "remoteItem": { + "type": "object", + "required": [ + "eTag", + "file", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "permissions" + ], + "properties": { + "name": { + "type": "string", + "enum": ["textfile.txt"] + }, + "permissions": { + "type": "array", + "items": [ + { + "type": "object", + "required": ["grantedToV2", "id", "invitation", "roles"], + "properties": { + "grantedToV2": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Brian Murphy"] + } + } + } + } + } + }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Alice Hansen"] + } + } + } + } + } + } + } + } + ] + } + } + } + } + } + ] + } + } + } + } + """ + + + Scenario: user lists the folder with same name shared by two users with him/her from project-space + Given using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "projectSpace1" with the default quota using the Graph API + And user "Alice" has created a space "projectSpace2" with the default quota using the Graph API + And user "Alice" has created a folder "folderToShare" in space "projectSpace1" + And user "Alice" has sent the following share invitation: + | resource | folderToShare | + | space | projectSpace1 | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + And user "Alice" has created a folder "folderToShare" in space "projectSpace2" + And user "Alice" has sent the following share invitation: + | resource | folderToShare | + | space | projectSpace2 | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + When user "Brian" lists the shares shared with him using the Graph API + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": ["value"], + "properties": { + "value": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { + "type": "boolean", + "enum": [false] + }, + "@client.synchronize": { + "type": "boolean", + "enum": [false] + }, + "name": { + "type": "string", + "enum": ["folderToShare"] + }, + "remoteItem": { + "type": "object", + "required": [ + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "permissions" + ], + "properties": { + "createdBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName","id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Carol King"] + } + } + } + } + }, + "name": { + "type": "string", + "enum": ["folderToShare"] + }, + "permissions": { + "type": "array", + "items": [ + { + "type": "object", + "required": ["grantedToV2", "id", "invitation", "roles"], + "properties": { + "grantedToV2": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Brian Murphy"] + } + } + } + } + } + }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Alice Hansen"] + } + } + } + } + } + } + } + } + ] + } + } + } + } + }, + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "createdBy", + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "remoteItem" + ], + "properties": { + "@UI.Hidden": { + "type": "boolean", + "enum": [false] + }, + "@client.synchronize": { + "type": "boolean", + "enum": [false] + }, + "createdBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Alice Hansen"] + } + } + } + } + }, + "name": { + "type": "string", + "enum": ["folderToShare"] + }, + "remoteItem": { + "type": "object", + "required": [ + "createdBy", + "eTag", + "folder", + "id", + "lastModifiedDateTime", + "name", + "parentReference", + "permissions" + ], + "properties": { + "createdBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Alice Hansen"] + } + } + } + } + }, + "name": { + "type": "string", + "enum": ["folderToShare"] + }, + "permissions": { + "type": "array", + "items": [ + { + "type": "object", + "required": ["grantedToV2", "id", "invitation", "roles"], + "properties": { + "grantedToV2": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Brian Murphy"] + } + } + } + } + } + }, + "invitation": { + "type": "object", + "required": ["invitedBy"], + "properties": { + "invitedBy": { + "type": "object", + "required": ["user"], + "properties": { + "user": { + "type": "object", + "required": ["displayName", "id"], + "properties": { + "displayName": { + "type": "string", + "enum": ["Alice Hansen"] + } + } + } + } + } + } + } + } + ] + } + } + } + } + } + ] + } + } + } + } + """