Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ScharfViktor committed Mar 20, 2024
1 parent b761f0c commit c5f9659
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 303 deletions.
1 change: 0 additions & 1 deletion tests/TestHelpers/SharingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class SharingHelper {
'update' => 2,
'create' => 4,
'delete' => 8,
// 'share' => 16,
'invite' => 0
];

Expand Down
8 changes: 0 additions & 8 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ File and sync features in a shared scenario
- [coreApiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature:159](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature#L159)
- [coreApiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature:160](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature#L160)

#### [sharing the shares folder to users exits with different status code than in oc10 backend](https://github.com/owncloud/ocis/issues/2215)

- [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:654](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L654)
- [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:655](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L655)
- [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:672](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L672)
- [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:673](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L673)
- [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:687](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L687)
- [coreApiShareManagementBasicToShares/createShareToSharesFolder.feature:688](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature#L688)

#### [file_target of an auto-renamed file is not correct directly after sharing](https://github.com/owncloud/core/issues/32322)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feature: Email notification

Scenario: user gets an email notification when someone shares a file
Given user "Alice" has uploaded file with content "sample text" to "lorem.txt"
When user "Alice" shares file "lorem.txt" with user "Brian" with permissions "17" using the sharing API
When user "Alice" shares file "lorem.txt" with user "Brian" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And user "Brian" should have received the following email from user "Alice"
Expand Down
16 changes: 16 additions & 0 deletions tests/acceptance/features/apiReshare/resharing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,19 @@ Feature: re-share resources
| new | viewer |
| spaces | editor |
| spaces | viewer |


Scenario Outline: try to create a link to the shared folder
Given using OCS API version "<ocs_api_version>"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
When user "Brian" creates a public link share using the sharing API with settings
| path | /Shares/test |
| permissions | 1 |
| password | %public% |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 403 | 200 |
| 2 | 403 | 403 |

2 changes: 1 addition & 1 deletion tests/acceptance/features/apiSpaces/listSpaces.feature
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Feature: List and create spaces
Scenario: ordinary user can request information about their Space via the Graph API using a filter
Given user "Brian" has been created with default attributes and without skeleton files
And user "Brian" has created folder "folder"
And user "Brian" has shared folder "folder" with user "Alice" with permissions "31"
And user "Brian" has shared folder "folder" with user "Alice" with permissions "15"
When user "Alice" lists all available spaces via the Graph API with query "$filter=driveType eq 'personal'"
Then the HTTP status code should be "200"
And the JSON response should contain space called "Alice Hansen" and match
Expand Down
66 changes: 33 additions & 33 deletions tests/acceptance/features/apiSpacesShares/copySpaces.feature
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Feature: copy file
And user "Brian" has shared a space "Project" with settings:
| shareWith | Alice |
| role | <role> |
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "31"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "15"
When user "Alice" copies file "/project.txt" from space "Project" to "/testshare/project.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Alice" folder "testshare" of the space "Shares" should contain these files:
Expand All @@ -137,7 +137,7 @@ Feature: copy file
And user "Brian" has shared a space "Project" with settings:
| shareWith | Alice |
| role | <role> |
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "17"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "1"
When user "Alice" copies file "/project.txt" from space "Project" to "/testshare/project.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" folder "testshare" of the space "Shares" should not contain these files:
Expand Down Expand Up @@ -182,7 +182,7 @@ Feature: copy file

Scenario: user copies a file from personal space to share space with role editor
Given user "Brian" has created folder "/testshare"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "31"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "15"
And user "Alice" has uploaded file with content "personal content" to "personal.txt"
When user "Alice" copies file "/personal.txt" from space "Personal" to "/testshare/personal.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "201"
Expand All @@ -193,7 +193,7 @@ Feature: copy file

Scenario: user copies a file from personal space to share space with role viewer
Given user "Brian" has created folder "/testshare"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "17"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "1"
And user "Alice" has uploaded file with content "personal content" to "/personal.txt"
When user "Alice" copies file "/personal.txt" from space "Personal" to "/testshare/personal.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "403"
Expand All @@ -213,8 +213,8 @@ Feature: copy file
And for user "Alice" the content of the file "/testshare.txt" of the space "Personal" should be "testshare content"
Examples:
| permissions |
| 31 |
| 17 |
| 15 |
| 1 |


Scenario Outline: user copies a file from share space with different role to project space with different role
Expand All @@ -233,10 +233,10 @@ Feature: copy file
And for user "Alice" the content of the file "/testshare.txt" of the space "Project" should be "testshare content"
Examples:
| role | permissions |
| manager | 31 |
| manager | 17 |
| editor | 31 |
| editor | 17 |
| manager | 15 |
| manager | 1 |
| editor | 15 |
| editor | 1 |


Scenario Outline: user copies a file from share space with different role to project space with role viewer
Expand All @@ -263,7 +263,7 @@ Feature: copy file
And user "Brian" has created folder "/testshare2"
And user "Brian" has uploaded file with content "testshare1 content" to "/testshare1/testshare1.txt"
And user "Brian" has shared folder "/testshare1" with user "Alice" with permissions "<permissions>"
And user "Brian" has shared folder "/testshare2" with user "Alice" with permissions "31"
And user "Brian" has shared folder "/testshare2" with user "Alice" with permissions "15"
When user "Alice" copies file "/testshare1/testshare1.txt" from space "Shares" to "/testshare2/testshare1.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Alice" folder "testshare2" of the space "Shares" should contain these files:
Expand All @@ -274,16 +274,16 @@ Feature: copy file
And for user "Brian" the content of the file "/testshare1/testshare1.txt" of the space "Personal" should be "testshare1 content"
Examples:
| permissions |
| 31 |
| 17 |
| 15 |
| 1 |


Scenario Outline: user copies a file from share space with different role to share space with role viewer
Given user "Brian" has created folder "/testshare1"
And user "Brian" has created folder "/testshare2"
And user "Brian" has uploaded file with content "testshare1 content" to "/testshare1/testshare1.txt"
And user "Brian" has shared folder "/testshare1" with user "Alice" with permissions "<permissions>"
And user "Brian" has shared folder "/testshare2" with user "Alice" with permissions "17"
And user "Brian" has shared folder "/testshare2" with user "Alice" with permissions "1"
When user "Alice" copies file "/testshare1/testshare1.txt" from space "Shares" to "/testshare2/testshare1.txt" inside space "Shares" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" folder "testshare2" of the space "Shares" should not contain these files:
Expand All @@ -292,8 +292,8 @@ Feature: copy file
| testshare1.txt |
Examples:
| permissions |
| 31 |
| 17 |
| 15 |
| 1 |


Scenario Outline: copying a folder within the same project space with different role
Expand Down Expand Up @@ -378,12 +378,12 @@ Feature: copy file
| <entry> |
Examples:
| role | shouldOrNot | permissions | status-code | parent-folder | entry |
| manager | should | 31 | 201 | testshare/folder1 | demo.txt |
| editor | should | 31 | 201 | testshare/folder1 | demo.txt |
| viewer | should | 31 | 201 | testshare/folder1 | demo.txt |
| manager | should not | 17 | 403 | testshare | folder1 |
| editor | should not | 17 | 403 | testshare | folder1 |
| viewer | should not | 17 | 403 | testshare | folder1 |
| manager | should | 15 | 201 | testshare/folder1 | demo.txt |
| editor | should | 15 | 201 | testshare/folder1 | demo.txt |
| viewer | should | 15 | 201 | testshare/folder1 | demo.txt |
| manager | should not | 1 | 403 | testshare | folder1 |
| editor | should not | 1 | 403 | testshare | folder1 |
| viewer | should not | 1 | 403 | testshare | folder1 |


Scenario Outline: user copies a folder from personal space to project space with different role
Expand Down Expand Up @@ -416,8 +416,8 @@ Feature: copy file
| <entry> |
Examples:
| permissions | shouldOrNot | status-code | parent-folder | entry |
| 31 | should | 201 | testshare/folder1 | demo.txt |
| 17 | should not | 403 | testshare | folder1 |
| 15 | should | 201 | testshare/folder1 | demo.txt |
| 1 | should not | 403 | testshare | folder1 |


Scenario Outline: user copies a folder from share space with different role to personal space
Expand All @@ -432,8 +432,8 @@ Feature: copy file
And for user "Alice" the content of the file "/testshare.txt" of the space "Personal" should be "testshare content"
Examples:
| permissions |
| 31 |
| 17 |
| 15 |
| 1 |


Scenario Outline: user copies a folder from share space with different role to project space with different role
Expand All @@ -452,10 +452,10 @@ Feature: copy file
| testshare.txt |
Examples:
| role | permissions |
| manager | 31 |
| manager | 17 |
| editor | 31 |
| editor | 17 |
| manager | 15 |
| manager | 1 |
| editor | 15 |
| editor | 1 |


Scenario Outline: user copies a folder from share space with different role to project space with role viewer
Expand All @@ -474,8 +474,8 @@ Feature: copy file
| folder1 |
Examples:
| permissions |
| 31 |
| 17 |
| 15 |
| 1 |


Scenario: copying a file to a folder with no permissions
Expand Down Expand Up @@ -775,7 +775,7 @@ Feature: copy file
When user "Brian" overwrites file "/personal.txt" from space "Personal" to "/newfolder/personal.txt" inside space "Shares" while copying using the WebDAV API
Then the HTTP status code should be "204"
And for user "Alice" folder "newfolder" of the space "Project" should contain these entries:
| personal.txt |
| personal.txt |
And for user "Alice" the content of the file "/newfolder/personal.txt" of the space "Project" should be "new content"
When user "Alice" downloads version of the file "/newfolder/personal.txt" with the index "1" of the space "Project" using the WebDAV API
Then the HTTP status code should be "200"
Expand Down
Loading

0 comments on commit c5f9659

Please sign in to comment.