diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index 0695f0c2355..117fc57ecee 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -1345,6 +1345,29 @@ public function theUserUploadsAFileToSpace( $this->featureContext->setResponse($response); } + /** + * @When /^user "([^"]*)" uploads a file inside federated space "([^"]*)" with content "([^"]*)" to "([^"]*)" using the WebDAV API$/ + * + * @param string $user + * @param string $spaceName + * @param string $content + * @param string $destination + * + * @return void + * @throws GuzzleException + * @throws Exception + */ + public function theUserUploadsAFileToFedratedSpace( + string $user, + string $spaceName, + string $content, + string $destination + ): void { + $spaceId = $this->featureContext->spacesContext->getSharesRemoteItemId($user, $destination); + $response = $this->featureContext->uploadFileWithContent($user, $content, $destination, $spaceId); + $this->featureContext->setResponse($response); + } + /** * @When /^user "([^"]*)" uploads a file "([^"]*)" to "([^"]*)" in space "([^"]*)" using the WebDAV API$/ * diff --git a/tests/acceptance/features/apiOcm/share.feature b/tests/acceptance/features/apiOcm/share.feature index c7c55117348..d5f0b93dedd 100755 --- a/tests/acceptance/features/apiOcm/share.feature +++ b/tests/acceptance/features/apiOcm/share.feature @@ -733,3 +733,26 @@ Feature: an user shares resources using ScienceMesh application 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-9898 + Scenario: user edists content of a federated share file + 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 using server "LOCAL" + And user "Alice" has uploaded file with content "ocm test" to "/textfile.txt" + And user "Alice" has sent the following resource share invitation to federated user: + | resource | textfile.txt | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | File Editor | + And using server "REMOTE" + And for user "Brian" the content of file "textfile.txt" of federated share "textfile.txt" should be "ocm test" + When user "Brian" uploads a file inside federated space "Shares" with content "this is a new content" to "textfile.txt" using the WebDAV API + Then the HTTP status code should be "204" + And for user "Brian" the content of file "textfile.txt" of federated share "textfile.txt" should be "this is a new content" + And using server "LOCAL" + And for user "Alice" the content of the file "textfile.txt" of the space "Personal" should be "this is a new content"