From 3e5ccad80f5b967d279e572eadcc1eb1e9972cc5 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Wed, 14 Feb 2024 14:07:44 +0545 Subject: [PATCH 1/3] auto-sync-disabled: Added tests to lists shares, when same file shared by two user --- .../sharedWithMeSyncDisabled.feature | 295 ++++++++++++++++++ 1 file changed, 295 insertions(+) diff --git a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature index 619a77b60..f24d7dc11 100644 --- a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature +++ b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature @@ -2198,3 +2198,298 @@ Feature: listing sharedWithMe when auto-sync is disabled } } """ + + + Scenario: user lists the file with same name shared by two users with him/her when auto sync is disabled + Given user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has uploaded file with content "to share" to "textfile.txt" + And user "Carol" has uploaded file with content "to share" to "textfile.txt" + And user "Brian" has disabled the auto-sync share + And user "Alice" has sent the following share invitation: + | resource | textfile.txt | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + And user "Carol" has sent the following share invitation: + | resource | textfile.txt | + | space | Personal | + | 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", + "items": { + "oneOf": [ + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "createdBy", + "eTag", + "file", + "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": ["Carol King"] + } + } + } + } + }, + "name": { + "type": "string", + "enum": ["textfile.txt"] + }, + "remoteItem": { + "type": "object", + "required": [ + "createdBy", + "eTag", + "file", + "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": ["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": ["Carol King"] + } + } + } + } + } + } + } + } + ] + } + } + } + } + }, + { + "type": "object", + "required": [ + "@UI.Hidden", + "@client.synchronize", + "createdBy", + "eTag", + "file", + "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": ["textfile.txt"] + }, + "remoteItem": { + "type": "object", + "required": [ + "createdBy", + "eTag", + "file", + "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": ["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"] + } + } + } + } + } + } + } + } + ] + } + } + } + } + } + ] + } + } + } + } + """ From 68692162606d6db157cb675a29ae2a61aa205033 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Wed, 14 Feb 2024 17:05:22 +0545 Subject: [PATCH 2/3] auto-sync-disabled: Added tests to lists shares, when same folder shared by two user --- .../sharedWithMeSyncDisabled.feature | 295 ++++++++++++++++++ 1 file changed, 295 insertions(+) diff --git a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature index f24d7dc11..8f468a7ce 100644 --- a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature +++ b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature @@ -2493,3 +2493,298 @@ Feature: listing sharedWithMe when auto-sync is disabled } } """ + + + Scenario: user lists the folder with same name shared by two users with him/her when auto sync is disabled + Given user "Carol" has been created with default attributes and without skeleton files + And user "Alice" has created folder "folderToShare" + And user "Carol" has created folder "folderToShare" + And user "Brian" has disabled the auto-sync share + And user "Alice" has sent the following share invitation: + | resource | folderToShare | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + And user "Carol" has sent the following share invitation: + | resource | folderToShare | + | space | Personal | + | 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", + "items": { + "oneOf": [ + { + "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": ["Carol King"] + } + } + } + } + }, + "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": ["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": ["Carol King"] + } + } + } + } + } + } + } + } + ] + } + } + } + } + }, + { + "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"] + } + } + } + } + } + } + } + } + ] + } + } + } + } + } + ] + } + } + } + } + """ From aa67452e2b501de82cc5f838d7995d683d6d0d93 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Tue, 20 Feb 2024 16:58:44 +0545 Subject: [PATCH 3/3] Strict check for json schema --- .../apiSharingNg/sharedWithMeSyncDisabled.feature | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature index 8f468a7ce..513b65baf 100644 --- a/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature +++ b/tests/acceptance/features/apiSharingNg/sharedWithMeSyncDisabled.feature @@ -2200,11 +2200,10 @@ Feature: listing sharedWithMe when auto-sync is disabled """ - Scenario: user lists the file with same name shared by two users with him/her when auto sync is disabled + Scenario: user lists the file with same name shared by two users with him/her Given user "Carol" has been created with default attributes and without skeleton files And user "Alice" has uploaded file with content "to share" to "textfile.txt" And user "Carol" has uploaded file with content "to share" to "textfile.txt" - And user "Brian" has disabled the auto-sync share And user "Alice" has sent the following share invitation: | resource | textfile.txt | | space | Personal | @@ -2227,6 +2226,8 @@ Feature: listing sharedWithMe when auto-sync is disabled "properties": { "value": { "type": "array", + "minItems": 2, + "maxItems": 2, "items": { "oneOf": [ { @@ -2495,11 +2496,10 @@ Feature: listing sharedWithMe when auto-sync is disabled """ - Scenario: user lists the folder with same name shared by two users with him/her when auto sync is disabled + Scenario: user lists the folder with same name shared by two users with him/her Given user "Carol" has been created with default attributes and without skeleton files And user "Alice" has created folder "folderToShare" And user "Carol" has created folder "folderToShare" - And user "Brian" has disabled the auto-sync share And user "Alice" has sent the following share invitation: | resource | folderToShare | | space | Personal | @@ -2522,6 +2522,8 @@ Feature: listing sharedWithMe when auto-sync is disabled "properties": { "value": { "type": "array", + "minItems": 2, + "maxItems": 2, "items": { "oneOf": [ {