Skip to content

Commit

Permalink
adding test for editing shared file(OCM) by the share receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
nirajacharya2 committed Nov 25, 2024
1 parent 2deeda7 commit 3ffcfad
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/acceptance/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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$/
*
Expand Down
23 changes: 23 additions & 0 deletions tests/acceptance/features/apiOcm/share.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 3ffcfad

Please sign in to comment.