-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests-Only] Refactor apiShareCreateSpecial1 to use Shares folder
- Loading branch information
1 parent
f1f272d
commit bdeae2c
Showing
10 changed files
with
1,075 additions
and
7 deletions.
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
760 changes: 760 additions & 0 deletions
760
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 | ||
And user "Brian" accepts share "/welcome.txt" offered by user "Alice" using the sharing API | ||
Then the OCS status code should be "<ocs_status_code>" | ||
And the HTTP status code should be "200" | ||
And 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 "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API | ||
And user "Alice" shares folder "/PARENT/CHILD" with group "grp4" 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 | | ||
And the OCS status code should be "<ocs_status_code>" | ||
And the HTTP status code should be "200" | ||
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 | ||
And user "Brian" accepts share "/test/sub" offered by user "Alice" using the sharing API | ||
Then the OCS status code should be "<ocs_status_code>" | ||
And the HTTP status code should be "200" | ||
And 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 | ||
And user "Brian" accepts share "/test/sub" offered by user "Alice" using the sharing API | ||
Then the OCS status code should be "<ocs_status_code>" | ||
And the HTTP status code should be "200" | ||
And 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)/ | |
80 changes: 80 additions & 0 deletions
80
...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,80 @@ | ||
@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 as "Alice" file "fileToShare.txt" should not exist | ||
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 as "Carol" file "fileToShare.txt" should not exist | ||
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 as "Alice" folder "folderToShare" should not exist | ||
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 as "Brian" folder "folderToShare" should not exist | ||
Examples: | ||
| ocs_api_version | http_status_code | | ||
| 1 | 200 | | ||
| 2 | 403 | |