Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] Added API tests to check file versions of shared file from project space by a sharee #7829

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ default:
contexts:
- FeatureContext: *common_feature_context_params
- WebDavPropertiesContext:
- FilesVersionsContext:

apiLocks:
paths:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Feature: checking file versions using file id
As a user
I want to share file outside of the space
So that other users can access the file


Scenario Outline: check the file versions of a shared file
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
And using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "Project1" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "Project1" with content "hello world version 1" to "text.txt"
And we save it into "FILEID"
And user "Alice" has uploaded a file inside space "Project1" with content "hello world version 1.1" to "text.txt"
And user "Alice" has created a share inside of space "Project1" with settings:
| path | text.txt |
| shareWith | Brian |
| role | <role> |
And using new DAV path
When user "Alice" gets the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "207"
And the number of versions should be "1"
When user "Brian" tries to get the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "403"
Examples:
| role |
| editor |
| viewer |
| all |
23 changes: 23 additions & 0 deletions tests/acceptance/features/bootstrap/FilesVersionsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,29 @@ public function getFileVersions(
);
}

/**
* @When user :user gets the number of versions of file :resource using file-id path :endpoint
saw-jan marked this conversation as resolved.
Show resolved Hide resolved
* @When user :user tries to get the number of versions of file :resource using file-id path :endpoint
*
* @param string $user
* @param string $endpoint
*
* @return void
*/
public function userGetsTheNumberOfVersionsOfFileOfTheSpace(string $user, string $endpoint):void {
$this->featureContext->setResponse(
$this->featureContext->makeDavRequest(
$user,
"PROPFIND",
$endpoint,
null,
null,
null,
(string)$this->featureContext->getDavPathVersion()
)
);
}

/**
* @When user :user gets the version metadata of file :file
*
Expand Down