mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-28 14:59:49 -05:00
Merge pull request #10651 from owncloud/tests-ocm-download-preview
[tests-only][full-ci] add tests to download thumbnail preview of a federated share image
This commit is contained in:
@@ -3711,6 +3711,41 @@ trait WebDav {
|
||||
$this->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When user :user downloads the preview of federated share image :path with width :width and height :height using the WebDAV API
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $path
|
||||
* @param string $width
|
||||
* @param string $height
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function userDownloadsThePreviewOfFederatedShareImageWithWidthHeightUsingWebDAVAPI(string $user, string $path, string $width, string $height): void {
|
||||
$user = $this->getActualUsername($user);
|
||||
$urlParameter = [
|
||||
'x' => $width,
|
||||
'y' => $height,
|
||||
'preview' => '1'
|
||||
];
|
||||
$spaceId = $this->spacesContext->getSharesRemoteItemId($user, $path);
|
||||
$this->setResponse(
|
||||
$this->makeDavRequest(
|
||||
$user,
|
||||
"GET",
|
||||
$path,
|
||||
[],
|
||||
null,
|
||||
$spaceId,
|
||||
"files",
|
||||
null,
|
||||
false,
|
||||
null,
|
||||
$urlParameter,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given user :user has downloaded the preview of shared resource :path with width :width and height :height
|
||||
*
|
||||
|
||||
@@ -707,11 +707,11 @@ Feature: an user shares resources using ScienceMesh application
|
||||
And using server "LOCAL"
|
||||
And user "Alice" has created a folder "FOLDER" in space "Personal"
|
||||
And user "Alice" has sent the following resource share invitation to federated user:
|
||||
| resource | FOLDER |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Editor |
|
||||
| resource | FOLDER |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Editor |
|
||||
When using server "REMOTE"
|
||||
And user "Brian" uploads a file with content "lorem" to "file.txt" inside federated share "FOLDER" via TUS using the WebDAV API
|
||||
Then for user "Brian" the content of file "file.txt" of federated share "FOLDER" should be "lorem"
|
||||
@@ -725,11 +725,31 @@ Feature: an user shares resources using ScienceMesh application
|
||||
And "Brian" has accepted invitation
|
||||
And user "Brian" has created a folder "FOLDER" in space "Personal"
|
||||
And user "Brian" has sent the following resource share invitation to federated user:
|
||||
| resource | FOLDER |
|
||||
| space | Personal |
|
||||
| sharee | Alice |
|
||||
| shareType | user |
|
||||
| permissionsRole | Editor |
|
||||
| resource | FOLDER |
|
||||
| space | Personal |
|
||||
| sharee | Alice |
|
||||
| shareType | user |
|
||||
| permissionsRole | Editor |
|
||||
When using server "LOCAL"
|
||||
And user "Alice" uploads a file with content "lorem" to "file.txt" inside federated share "FOLDER" via TUS using the WebDAV API
|
||||
Then for user "Alice" the content of file "file.txt" of federated share "FOLDER" should be "lorem"
|
||||
|
||||
@issue-10495
|
||||
Scenario: local user downloads thumbnail preview of a federated shared image
|
||||
Given using spaces DAV path
|
||||
And using server "LOCAL"
|
||||
And "Alice" has created the federation share invitation
|
||||
And using server "REMOTE"
|
||||
And "Brian" has accepted invitation
|
||||
And user "Brian" has uploaded file "filesForUpload/testavatar.jpg" to "testavatar.jpg"
|
||||
And user "Brian" has sent the following resource share invitation to federated user:
|
||||
| resource | testavatar.jpg |
|
||||
| space | Personal |
|
||||
| sharee | Alice |
|
||||
| shareType | user |
|
||||
| permissionsRole | Viewer |
|
||||
And using server "LOCAL"
|
||||
When user "Alice" downloads the preview of federated share image "testavatar.jpg" with width "32" and height "32" using the WebDAV API
|
||||
Then the HTTP status code should be "200"
|
||||
And the downloaded image should be "32" pixels wide and "32" pixels high
|
||||
And the downloaded preview content should match with "thumbnail.png" fixtures preview content
|
||||
|
||||
Reference in New Issue
Block a user