diff --git a/tests/acceptance/TestHelpers/GraphHelper.php b/tests/acceptance/TestHelpers/GraphHelper.php index 93637bc95a..dcc8ad263c 100644 --- a/tests/acceptance/TestHelpers/GraphHelper.php +++ b/tests/acceptance/TestHelpers/GraphHelper.php @@ -2030,7 +2030,7 @@ class GraphHelper { string $user, string $password ): ResponseInterface { - $url = self::getBetaFullUrl($baseUrl, "me/drive/sharedWithMe"); + $url = self::getBetaFullUrl($baseUrl, "me/drive/sharedWithMe?\$expand=thumbnails"); return HttpRequestHelper::get( $url, $xRequestId, @@ -2055,7 +2055,7 @@ class GraphHelper { string $user, string $password ): ResponseInterface { - $url = self::getBetaFullUrl($baseUrl, "me/drive/sharedByMe"); + $url = self::getBetaFullUrl($baseUrl, "me/drive/sharedByMe?\$expand=thumbnails"); return HttpRequestHelper::get( $url, $xRequestId, diff --git a/tests/acceptance/features/apiContract/sharesReport.feature b/tests/acceptance/features/apiContract/sharesReport.feature index 19f4acd9d2..9488cf894f 100644 --- a/tests/acceptance/features/apiContract/sharesReport.feature +++ b/tests/acceptance/features/apiContract/sharesReport.feature @@ -46,6 +46,7 @@ Feature: REPORT request to Shares space Scenario Outline: check the REPORT response of the found file Given using DAV path And user "Alice" has uploaded file with content "Not all those who wander are lost." to "/folderMain/SubFolder1/subFOLDER2/frodo.txt" + And user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "/folderMain/SubFolder1/subFOLDER2/testavatar.jpg" When user "Brian" searches for "frodo.txt" using the WebDAV API Then the HTTP status code should be "207" And the following headers should match these regular expressions @@ -61,6 +62,21 @@ Feature: REPORT request to Shares space | oc:privatelink | %base_url%/f/[0-9a-z-$%]+ | | d:getcontentlength | 34 | | oc:remote-item-id | %file_id_pattern% | + When user "Brian" searches for "testavatar.jpg" using the WebDAV API + Then the HTTP status code should be "207" + And the following headers should match these regular expressions + | X-Request-Id | %request_id_pattern% | + And as user "Brian" the REPORT response should contain a resource "testavatar.jpg" with these key and value pairs: + | key | value | + | oc:fileid | %file_id_pattern% | + | oc:file-parent | %file_id_pattern% | + | oc:shareroot | /folderMain | + | oc:name | testavatar.jpg | + | d:getcontenttype | image/jpeg | + | oc:permissions | S | + | oc:privatelink | %base_url%/f/[0-9a-z-$%]+ | + | oc:has-preview | 1 | + | oc:remote-item-id | %file_id_pattern% | Examples: | dav-path-version | | old | diff --git a/tests/acceptance/features/apiSharingNg1/sharedByMe.feature b/tests/acceptance/features/apiSharingNg1/sharedByMe.feature index 365c2b0b5e..2b4d69ae60 100644 --- a/tests/acceptance/features/apiSharingNg1/sharedByMe.feature +++ b/tests/acceptance/features/apiSharingNg1/sharedByMe.feature @@ -139,6 +139,68 @@ Feature: resources shared by user | Viewer | + Scenario: sharer gets thumbnails when listing shared image file (Personal space) + Given user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "testavatar.jpg" + And user "Alice" has sent the following resource share invitation: + | resource | testavatar.jpg | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + When user "Alice" lists the shares shared by her using the Graph API + Then the HTTP status code should be "200" + And the JSON data of the response should contain resource "testavatar.jpg" with the following data: + """ + { + "type": "object", + "required": [ "thumbnails" ], + "properties": { + "thumbnails": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": ["small", "medium", "large"], + "properties": { + "small": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=36.*y=36" + } + } + }, + "medium": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=48.*y=48" + } + } + }, + "large": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=96.*y=96" + } + } + } + } + } + } + } + } + """ + + Scenario: sharer lists the file share shared from inside a folder (Personal space) Given user "Alice" has created folder "FolderToShare" And user "Alice" has uploaded file with content "hello world" to "FolderToShare/textfile.txt" diff --git a/tests/acceptance/features/apiSharingNg1/sharedWithMe.feature b/tests/acceptance/features/apiSharingNg1/sharedWithMe.feature index 46d1547cf5..7827c80838 100755 --- a/tests/acceptance/features/apiSharingNg1/sharedWithMe.feature +++ b/tests/acceptance/features/apiSharingNg1/sharedWithMe.feature @@ -315,6 +315,79 @@ Feature: an user gets the resources shared to them | Viewer | + Scenario: sharee gets thumbnails when listing shared image file (Personal space) + Given user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "testavatar.jpg" + And user "Alice" has sent the following resource share invitation: + | resource | testavatar.jpg | + | 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", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": ["thumbnails"], + "properties": { + "thumbnails": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "object", + "required": ["small", "medium", "large"], + "properties": { + "small": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=36.*y=36" + } + } + }, + "medium": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=48.*y=48" + } + } + }, + "large": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "pattern": "^https://.*scalingup=0.*preview=1.*processor=thumbnail.*x=96.*y=96" + } + } + } + } + } + } + } + } + } + } + } + """ + + Scenario Outline: sharee lists the folder share (Personal space) Given user "Alice" has created folder "folder" And user "Alice" has sent the following resource share invitation: