-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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] Refactor apiShareCreateSpecial1 to use Shares folder #37938
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...pecial1/createShareExpirationDate.feature → ...alRoot1/createShareExpirationDate.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...createShareReceivedInMultipleWays.feature → ...createShareReceivedInMultipleWays.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...l1/createShareUniqueReceivedNames.feature → ...t1/createShareUniqueReceivedNames.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...reateShareWhenExcludedFromSharing.feature → ...reateShareWhenExcludedFromSharing.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,000 changes: 1,000 additions & 0 deletions
1,000
tests/acceptance/features/apiShareCreateSpecialShares1/createShareExpirationDate.feature
Large diffs are not rendered by default.
Oops, something went wrong.
192 changes: 192 additions & 0 deletions
192
...cceptance/features/apiShareCreateSpecialShares1/createShareReceivedInMultipleWays.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-34 | ||
Feature: share resources where the sharee receives the share in multiple ways | ||
|
||
Background: | ||
Given the administrator has set the default folder for received shares to "Shares" | ||
And auto-accept shares has been disabled | ||
And user "Alice" has been created with default attributes and skeleton files | ||
|
||
Scenario Outline: Creating a new share with user who already received a share through their group | ||
Given using OCS API version "<ocs_api_version>" | ||
And user "Brian" has been created with default attributes and without skeleton files | ||
And group "grp1" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And user "Alice" has shared file "welcome.txt" with group "grp1" | ||
And user "Brian" has accepted share "/welcome.txt" offered by user "Alice" | ||
When user "Alice" shares file "/welcome.txt" with user "Brian" using the sharing API | ||
Then the OCS status code should be "<ocs_status_code>" | ||
And the HTTP status code should be "200" | ||
When user "Brian" accepts share "/welcome.txt" offered by user "Alice" using the sharing API | ||
Then the fields of the last response to user "Alice" sharing with user "Brian" should include | ||
| share_with | %username% | | ||
| share_with_displayname | %displayname% | | ||
| file_target | /Shares/welcome (2).txt | | ||
| path | /Shares/welcome (2).txt | | ||
| permissions | share,read,update | | ||
| uid_owner | %username% | | ||
| displayname_owner | %displayname% | | ||
| item_type | file | | ||
| mimetype | text/plain | | ||
| storage_id | ANY_VALUE | | ||
| share_type | user | | ||
Examples: | ||
| ocs_api_version | ocs_status_code | | ||
| 1 | 100 | | ||
| 2 | 200 | | ||
|
||
@issue-ocis-reva-243 | ||
Scenario Outline: Share of folder and sub-folder to same user - core#20645 | ||
Given using OCS API version "<ocs_api_version>" | ||
And user "Brian" has been created with default attributes and skeleton files | ||
And group "grp4" has been created | ||
And user "Brian" has been added to group "grp4" | ||
When user "Alice" shares folder "/PARENT" with user "Brian" using the sharing API | ||
And user "Alice" shares folder "/PARENT/CHILD" with group "grp4" using the sharing API | ||
Then the OCS status code should be "<ocs_status_code>" | ||
And the HTTP status code should be "200" | ||
When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API | ||
And user "Brian" accepts share "/PARENT/CHILD" offered by user "Alice" using the sharing API | ||
Then user "Brian" should see the following elements | ||
| /FOLDER/ | | ||
| /Shares/PARENT/ | | ||
| /Shares/PARENT/parent.txt | | ||
| /PARENT/ | | ||
| /PARENT/parent.txt | | ||
| /Shares/CHILD/ | | ||
| /Shares/CHILD/child.txt | | ||
Examples: | ||
| ocs_api_version | ocs_status_code | | ||
| 1 | 100 | | ||
| 2 | 200 | | ||
|
||
@issue-ocis-reva-243 | ||
Scenario Outline: sharing subfolder when parent already shared | ||
Given using OCS API version "<ocs_api_version>" | ||
And user "Brian" has been created with default attributes and without skeleton files | ||
And group "grp1" has been created | ||
And user "Alice" has created folder "/test" | ||
And user "Alice" has created folder "/test/sub" | ||
And user "Alice" has shared folder "/test" with group "grp1" | ||
When user "Alice" shares folder "/test/sub" with user "Brian" using the sharing API | ||
Then the OCS status code should be "<ocs_status_code>" | ||
And the HTTP status code should be "200" | ||
Comment on lines
+71
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step is supposed to check the status code of sharing step but here it checks the status of accepting the share. |
||
When user "Brian" accepts share "/test/sub" offered by user "Alice" using the sharing API | ||
Then as "Brian" folder "/Shares/sub" should exist | ||
Examples: | ||
| ocs_api_version | ocs_status_code | | ||
| 1 | 100 | | ||
| 2 | 200 | | ||
|
||
@issue-ocis-reva-243 | ||
Scenario Outline: sharing subfolder when parent already shared with group of sharer | ||
Given using OCS API version "<ocs_api_version>" | ||
And user "Brian" has been created with default attributes and without skeleton files | ||
And group "grp0" has been created | ||
And user "Alice" has been added to group "grp0" | ||
And user "Alice" has created folder "/test" | ||
And user "Alice" has created folder "/test/sub" | ||
And user "Alice" has shared folder "/test" with group "grp0" | ||
When user "Alice" shares folder "/test/sub" with user "Brian" using the sharing API | ||
Then the OCS status code should be "<ocs_status_code>" | ||
And the HTTP status code should be "200" | ||
When user "Brian" accepts share "/test/sub" offered by user "Alice" using the sharing API | ||
Then as "Brian" folder "/Shares/sub" should exist | ||
Examples: | ||
| ocs_api_version | ocs_status_code | | ||
| 1 | 100 | | ||
| 2 | 200 | | ||
|
||
@issue-ocis-reva-243 | ||
Scenario Outline: multiple users share a file with the same name but different permissions to a user | ||
Given using OCS API version "<ocs_api_version>" | ||
And these users have been created with default attributes and without skeleton files: | ||
| username | | ||
| Brian | | ||
| Carol | | ||
And user "Brian" has uploaded file with content "First data" to "/randomfile.txt" | ||
And user "Carol" has uploaded file with content "Second data" to "/randomfile.txt" | ||
When user "Brian" shares file "randomfile.txt" with user "Alice" with permissions "read" using the sharing API | ||
And user "Alice" accepts share "/randomfile.txt" offered by user "Brian" using the sharing API | ||
And user "Alice" gets the info of the last share using the sharing API | ||
Then the fields of the last response about user "Brian" sharing with user "Alice" should include | ||
| uid_owner | %username% | | ||
| share_with | %username% | | ||
| file_target | /Shares/randomfile.txt | | ||
| item_type | file | | ||
| permissions | read | | ||
When user "Carol" shares file "randomfile.txt" with user "Alice" with permissions "read,update" using the sharing API | ||
And user "Alice" accepts share "/randomfile.txt" offered by user "Carol" using the sharing API | ||
And user "Alice" gets the info of the last share using the sharing API | ||
Then the fields of the last response about user "Carol" sharing with user "Alice" should include | ||
| uid_owner | %username% | | ||
| share_with | %username% | | ||
| file_target | /Shares/randomfile (2).txt | | ||
| item_type | file | | ||
| permissions | read,update | | ||
And the content of file "/Shares/randomfile.txt" for user "Alice" should be "First data" | ||
And the content of file "/Shares/randomfile (2).txt" for user "Alice" should be "Second data" | ||
Examples: | ||
| ocs_api_version | | ||
| 1 | | ||
| 2 | | ||
|
||
@issue-ocis-reva-243 | ||
Scenario Outline: multiple users share a folder with the same name to a user | ||
Given using OCS API version "<ocs_api_version>" | ||
And these users have been created with default attributes and without skeleton files: | ||
| username | | ||
| Brian | | ||
| Carol | | ||
And user "Brian" has created folder "/zzzfolder" | ||
And user "Brian" has created folder "zzzfolder/Brian" | ||
And user "Carol" has created folder "/zzzfolder" | ||
And user "Carol" has created folder "zzzfolder/Carol" | ||
When user "Brian" shares folder "zzzfolder" with user "Alice" with permissions "read,delete" using the sharing API | ||
And user "Alice" accepts share "/zzzfolder" offered by user "Brian" using the sharing API | ||
And user "Alice" gets the info of the last share using the sharing API | ||
Then the fields of the last response about user "Brian" sharing with user "Alice" should include | ||
| uid_owner | %username% | | ||
| share_with | %username% | | ||
| file_target | /Shares/zzzfolder | | ||
| item_type | folder | | ||
| permissions | read,delete | | ||
When user "Carol" shares folder "zzzfolder" with user "Alice" with permissions "read,share" using the sharing API | ||
And user "Alice" accepts share "/zzzfolder" offered by user "Carol" using the sharing API | ||
And user "Alice" gets the info of the last share using the sharing API | ||
Then the fields of the last response about user "Carol" sharing with user "Alice" should include | ||
| uid_owner | %username% | | ||
| share_with | %username% | | ||
| file_target | /Shares/zzzfolder (2) | | ||
| item_type | folder | | ||
| permissions | read,share | | ||
And as "Alice" folder "/Shares/zzzfolder/Brian" should exist | ||
And as "Alice" folder "/Shares/zzzfolder (2)/Carol" should exist | ||
Examples: | ||
| ocs_api_version | | ||
| 1 | | ||
| 2 | | ||
|
||
@skipOnEncryptionType:user-keys @encryption-issue-132 @skipOnLDAP | ||
Scenario Outline: share with a group and then add a user to that group that already has a file with the shared name | ||
Given using OCS API version "<ocs_api_version>" | ||
And these users have been created with default attributes and without skeleton files: | ||
| username | | ||
| Brian | | ||
| Carol | | ||
And these groups have been created: | ||
| groupname | | ||
| grp1 | | ||
And user "Brian" has been added to group "grp1" | ||
And user "Alice" has uploaded file with content "Shared content" to "lorem.txt" | ||
And user "Carol" has uploaded file with content "My content" to "lorem.txt" | ||
When user "Alice" shares file "lorem.txt" with group "grp1" using the sharing API | ||
And user "Brian" accepts share "/lorem.txt" offered by user "Alice" using the sharing API | ||
And the administrator adds user "Carol" to group "grp1" using the provisioning API | ||
And user "Carol" accepts share "/lorem.txt" offered by user "Alice" using the sharing API | ||
Then the content of file "Shares/lorem.txt" for user "Brian" should be "Shared content" | ||
And the content of file "lorem.txt" for user "Carol" should be "My content" | ||
And the content of file "Shares/lorem.txt" for user "Carol" should be "Shared content" | ||
Examples: | ||
| ocs_api_version | | ||
| 1 | | ||
| 2 | |
24 changes: 24 additions & 0 deletions
24
...s/acceptance/features/apiShareCreateSpecialShares1/createShareUniqueReceivedNames.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-11 @issue-ocis-reva-243 | ||
Feature: resources shared with the same name are received with unique names | ||
|
||
Background: | ||
Given the administrator has set the default folder for received shares to "Shares" | ||
And auto-accept shares has been disabled | ||
And using OCS API version "1" | ||
And these users have been created with default attributes and without skeleton files: | ||
| username | | ||
| Alice | | ||
| Brian | | ||
| Carol | | ||
|
||
@smokeTest | ||
Scenario: unique target names for incoming shares | ||
Given user "Alice" has created folder "/foo" | ||
And user "Brian" has created folder "/foo" | ||
When user "Alice" shares folder "/foo" with user "Carol" using the sharing API | ||
And user "Carol" accepts share "/foo" offered by user "Alice" using the sharing API | ||
And user "Brian" shares folder "/foo" with user "Carol" using the sharing API | ||
And user "Carol" accepts share "/foo" offered by user "Brian" using the sharing API | ||
Then user "Carol" should see the following elements | ||
| /Shares/foo/ | | ||
| /Shares/foo%20(2)/ | |
88 changes: 88 additions & 0 deletions
88
...ceptance/features/apiShareCreateSpecialShares1/createShareWhenExcludedFromSharing.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-41 | ||
Feature: cannot share resources when in a group that is excluded from sharing | ||
|
||
Background: | ||
Given the administrator has set the default folder for received shares to "Shares" | ||
And auto-accept shares has been disabled | ||
And user "Alice" has been created with default attributes and skeleton files | ||
|
||
Scenario Outline: user who is excluded from sharing tries to share a file with another user | ||
Given using OCS API version "<ocs_api_version>" | ||
And user "Brian" has been created with default attributes and skeleton files | ||
And group "grp1" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And parameter "shareapi_exclude_groups" of app "core" has been set to "yes" | ||
And parameter "shareapi_exclude_groups_list" of app "core" has been set to '["grp1"]' | ||
And user "Brian" has moved file "welcome.txt" to "fileToShare.txt" | ||
When user "Brian" shares file "fileToShare.txt" with user "Alice" using the sharing API | ||
Then the OCS status code should be "403" | ||
And the HTTP status code should be "<http_status_code>" | ||
And the sharing API should report to user "Alice" that no shares are in the pending state | ||
And as "Alice" file "Shares/fileToShare.txt" should not exist | ||
And as "Alice" file "fileToShare.txt" should not exist | ||
phil-davis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Examples: | ||
| ocs_api_version | http_status_code | | ||
| 1 | 200 | | ||
| 2 | 403 | | ||
|
||
Scenario Outline: user who is excluded from sharing tries to share a file with a group | ||
Given using OCS API version "<ocs_api_version>" | ||
And user "Brian" has been created with default attributes and skeleton files | ||
And user "Carol" has been created with default attributes and without skeleton files | ||
And group "grp1" has been created | ||
And group "grp2" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And user "Carol" has been added to group "grp2" | ||
And parameter "shareapi_exclude_groups" of app "core" has been set to "yes" | ||
And parameter "shareapi_exclude_groups_list" of app "core" has been set to '["grp1"]' | ||
And user "Brian" has moved file "welcome.txt" to "fileToShare.txt" | ||
When user "Brian" shares file "fileToShare.txt" with group "grp2" using the sharing API | ||
Then the OCS status code should be "403" | ||
And the HTTP status code should be "<http_status_code>" | ||
And the sharing API should report to user "Carol" that no shares are in the pending state | ||
And as "Carol" file "Shares/fileToShare.txt" should not exist | ||
And as "Carol" file "fileToShare.txt" should not exist | ||
phil-davis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Examples: | ||
| ocs_api_version | http_status_code | | ||
| 1 | 200 | | ||
| 2 | 403 | | ||
|
||
Scenario Outline: user who is excluded from sharing tries to share a folder with another user | ||
Given using OCS API version "<ocs_api_version>" | ||
And user "Brian" has been created with default attributes and without skeleton files | ||
And group "grp1" has been created | ||
And user "Brian" has been added to group "grp1" | ||
And parameter "shareapi_exclude_groups" of app "core" has been set to "yes" | ||
And parameter "shareapi_exclude_groups_list" of app "core" has been set to '["grp1"]' | ||
And user "Brian" has created folder "folderToShare" | ||
When user "Brian" shares folder "folderToShare" with user "Alice" using the sharing API | ||
Then the OCS status code should be "403" | ||
And the HTTP status code should be "<http_status_code>" | ||
And the sharing API should report to user "Alice" that no shares are in the pending state | ||
And as "Alice" folder "Shares/folderToShare" should not exist | ||
And as "Alice" folder "folderToShare" should not exist | ||
phil-davis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Examples: | ||
| ocs_api_version | http_status_code | | ||
| 1 | 200 | | ||
| 2 | 403 | | ||
|
||
Scenario Outline: user who is excluded from sharing tries to share a folder with a group | ||
Given using OCS API version "<ocs_api_version>" | ||
And user "Brian" has been created with default attributes and without skeleton files | ||
And group "grp0" has been created | ||
And group "grp1" has been created | ||
And user "Alice" has been added to group "grp0" | ||
And user "Brian" has been added to group "grp1" | ||
And parameter "shareapi_exclude_groups" of app "core" has been set to "yes" | ||
And parameter "shareapi_exclude_groups_list" of app "core" has been set to '["grp0"]' | ||
And user "Alice" has created folder "folderToShare" | ||
When user "Alice" shares folder "folderToShare" with group "grp1" using the sharing API | ||
Then the OCS status code should be "403" | ||
And the HTTP status code should be "<http_status_code>" | ||
And the sharing API should report to user "Brian" that no shares are in the pending state | ||
And as "Brian" folder "Shares/folderToShare" should not exist | ||
And as "Brian" folder "folderToShare" should not exist | ||
phil-davis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Examples: | ||
| ocs_api_version | http_status_code | | ||
| 1 | 200 | | ||
| 2 | 403 | |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step is supposed to check the status code of sharing step but here it checks the status of accepting the share.