Skip to content

Commit

Permalink
[Tests-Only] refactor shareOperations test suite for Shares subfolder…
Browse files Browse the repository at this point in the history
… and root
  • Loading branch information
dpakach committed Sep 22, 2020
1 parent f049399 commit 974894c
Show file tree
Hide file tree
Showing 13 changed files with 899 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ config = {
'apiShareManagement',
'apiShareToRootManagementBasic',
'apiShareToSharesManagementBasic',
'apiShareOperations',
'apiShareOperationsToRoot',
'apiShareOperationsToShares',
'apiSharePublicLink1',
'apiSharePublicLink2',
'apiShareReshareToRoot1',
Expand Down
15 changes: 13 additions & 2 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,20 @@ default:
- WebDavPropertiesContext:
- AuthContext:

apiShareOperations:
apiShareOperationsToRoot:
paths:
- '%paths.base%/../features/apiShareOperations'
- '%paths.base%/../features/apiShareOperationsToRoot'
context: *common_ldap_suite_context
contexts:
- FeatureContext: *common_feature_context_params
- OccContext:
- PublicWebDavContext:
- TrashbinContext:
- WebDavPropertiesContext:

apiShareOperationsToShares:
paths:
- '%paths.base%/../features/apiShareOperationsToShares'
context: *common_ldap_suite_context
contexts:
- FeatureContext: *common_feature_context_params
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @files_sharing-app-required
@api @files_sharing-app-required @notToImplementOnOCIS
Feature: sharing

Background:
Expand Down Expand Up @@ -34,7 +34,7 @@ Feature: sharing
| 1 | 100 |
| 2 | 200 |

@smokeTest @issue-ocis-reva-260
@smokeTest
Scenario Outline: Sharee can't see the share that is filtered out
Given using OCS API version "<ocs_api_version>"
And user "Alice" has shared file "textfile0.txt" with user "Brian"
Expand All @@ -48,7 +48,7 @@ Feature: sharing
| 1 | 100 |
| 2 | 200 |

@smokeTest @issue-ocis-reva-34 @issue-ocis-reva-194 @toImplementOnOCIS
@smokeTest
Scenario Outline: Sharee can see the group share
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-14 @issue-ocis-reva-243
@api @files_sharing-app-required @notToImplementOnOCIS
Feature: sharing

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @files_sharing-app-required @issue-ocis-reva-47
@api @files_sharing-app-required @notToImplementOnOCIS
Feature: sharing

Background:
Expand All @@ -8,7 +8,7 @@ Feature: sharing
| Alice |
| Brian |

@smokeTest @issue-ocis-reva-47
@smokeTest
Scenario Outline: Correct webdav share-permissions for owned file
Given using <dav-path> DAV path
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
Expand All @@ -21,7 +21,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received file with edit and reshare permissions
Given using <dav-path> DAV path
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
Expand All @@ -35,7 +34,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received group shared file with edit and reshare permissions
Given using <dav-path> DAV path
And group "grp1" has been created
Expand All @@ -55,7 +53,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received file with edit permissions but no reshare permissions
Given using <dav-path> DAV path
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
Expand All @@ -68,7 +65,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received group shared file with edit permissions but no reshare permissions
Given using <dav-path> DAV path
And group "grp1" has been created
Expand All @@ -88,7 +84,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received file with reshare permissions but no edit permissions
Given using <dav-path> DAV path
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
Expand All @@ -101,7 +96,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received group shared file with reshare permissions but no edit permissions
Given using <dav-path> DAV path
And group "grp1" has been created
Expand Down Expand Up @@ -134,7 +128,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received folder with all permissions
Given using <dav-path> DAV path
And user "Alice" has created folder "/tmp"
Expand All @@ -148,7 +141,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions
Given using <dav-path> DAV path
And group "grp1" has been created
Expand All @@ -167,7 +159,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received folder with all permissions but edit
Given using <dav-path> DAV path
And user "Alice" has created folder "/tmp"
Expand All @@ -180,7 +171,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions but edit
Given using <dav-path> DAV path
And group "grp1" has been created
Expand All @@ -200,7 +190,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received folder with all permissions but create
Given using <dav-path> DAV path
And user "Alice" has created folder "/tmp"
Expand All @@ -213,7 +202,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions but create
Given using <dav-path> DAV path
And group "grp1" has been created
Expand All @@ -233,7 +221,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received folder with all permissions but delete
Given using <dav-path> DAV path
And user "Alice" has created folder "/tmp"
Expand All @@ -246,7 +233,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions but delete
Given using <dav-path> DAV path
And group "grp1" has been created
Expand All @@ -266,7 +252,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received folder with all permissions but share
Given using <dav-path> DAV path
And user "Alice" has created folder "/tmp"
Expand All @@ -279,7 +264,6 @@ Feature: sharing
| old |
| new |

@toImplementOnOCIS @issue-ocis-reva-243
Scenario Outline: Correct webdav share-permissions for received group shared folder with all permissions but share
Given using <dav-path> DAV path
And group "grp1" has been created
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
@api @files_sharing-app-required @notToImplementOnOCIS
Feature: sharing

Background:
Given these users have been created with default attributes and skeleton files:
| username |
| Alice |
| Brian |

@smokeTest
Scenario Outline: getting all shares of a user using that user
Given using OCS API version "<ocs_api_version>"
And user "Alice" has moved file "/textfile0.txt" to "/file_to_share.txt"
And user "Alice" has shared file "file_to_share.txt" with user "Brian"
When user "Alice" gets all shares shared by him using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And file "file_to_share.txt" should be included in the response
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: getting all shares of a user using another user
Given using OCS API version "<ocs_api_version>"
And user "Alice" has shared file "textfile0.txt" with user "Brian"
When the administrator gets all shares shared by him using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And file "textfile0.txt" should not be included in the response
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

@smokeTest
Scenario Outline: getting all shares of a file
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and skeleton files:
| username |
| Carol |
| David |
And user "Alice" has shared file "textfile0.txt" with user "Brian"
And user "Alice" has shared file "textfile0.txt" with user "Carol"
When user "Alice" gets all the shares from the file "textfile0.txt" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Brian" should be included in the response
And user "Carol" should be included in the response
And user "David" should not be included in the response
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

@smokeTest
Scenario Outline: getting all shares of a file with reshares
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and skeleton files:
| username |
| Carol |
| David |
And user "Alice" has shared file "textfile0.txt" with user "Brian"
And user "Brian" has shared file "textfile0 (2).txt" with user "Carol"
When user "Alice" gets all the shares with reshares from the file "textfile0.txt" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Brian" should be included in the response
And user "Carol" should be included in the response
And user "David" should not be included in the response
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

@smokeTest
Scenario Outline: User's own shares reshared to him don't appear when getting "shared with me" shares
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Carol" has been created with default attributes and skeleton files
And user "Carol" has been added to group "grp1"
And user "Carol" has created folder "/shared"
And user "Carol" has moved file "/textfile0.txt" to "/shared/shared_file.txt"
And user "Carol" has shared folder "/shared" with user "Brian"
And user "Brian" has shared folder "/shared" with group "grp1"
When user "Carol" gets all the shares shared with him using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the last share id should not be included in the response
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

@issue-ocis-reva-374
Scenario Outline: Get a share with a user that didn't receive the share
Given using OCS API version "<ocs_api_version>"
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has shared file "textfile0.txt" with user "Brian"
When user "Carol" gets the info of the last share using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |

@skipOnLDAP
Scenario: Share of folder to a group, remove user from that group
Given using OCS API version "1"
And user "Carol" has been created with default attributes and skeleton files
And group "group0" has been created
And user "Brian" has been added to group "group0"
And user "Carol" has been added to group "group0"
And user "Alice" has shared folder "/PARENT" with group "group0"
When the administrator removes user "Carol" from group "group0" using the provisioning API
Then user "Brian" should see the following elements
| /FOLDER/ |
| /PARENT/ |
| /PARENT/parent.txt |
| /PARENT%20(2)/ |
| /PARENT%20(2)/parent.txt |
And user "Carol" should see the following elements
| /FOLDER/ |
| /PARENT/ |
| /PARENT/parent.txt |
But user "Carol" should not see the following elements
| /PARENT%20(2)/ |
| /PARENT%20(2)/parent.txt |

Scenario Outline: getting all the shares inside the folder
Given using OCS API version "<ocs_api_version>"
And user "Alice" has shared file "PARENT/parent.txt" with user "Brian"
When user "Alice" gets all the shares inside the folder "PARENT" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And file "parent.txt" should be included in the response
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @files_sharing-app-required @toImplementOnOCIS @issue-ocis-reva-11 @issue-ocis-reva-243
@api @files_sharing-app-required @notToImplementOnOCIS
Feature: sharing

Background:
Expand Down
Loading

0 comments on commit 974894c

Please sign in to comment.