Skip to content

Commit

Permalink
tests: update tests related to deletion of public link password to us…
Browse files Browse the repository at this point in the history
…e ocsv2 as well
  • Loading branch information
SwikritiT committed Dec 5, 2023
1 parent 62afc6e commit 6beaa0d
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 41 deletions.
20 changes: 14 additions & 6 deletions tests/acceptance/features/apiSpacesShares/shareOperations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ Feature: sharing

Scenario Outline: space admin tries to remove password of a public link share (change/create permission)
Given using spaces DAV path
And using OCS API version "<ocs_api_version>"
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
Expand All @@ -365,17 +366,20 @@ Feature: sharing
| path | /FOLDER |
| permissions | <permissions> |
| password | |
Then the HTTP status code should be "200"
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Examples:
| permissions |
| change |
| create |
| ocs_api_version | permissions | http_status_code |
| 1 | change | 200 |
| 2 | change | 400 |
| 1 | create | 200 |
| 2 | create | 400 |


Scenario: space admin removes password of a public link share (read permission)
Scenario Outline: space admin removes password of a public link share (read permission)
Given using spaces DAV path
And using OCS API version "<ocs_api_version>"
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a public link share with settings
Expand All @@ -387,4 +391,8 @@ Feature: sharing
| permissions | read |
| password | |
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And the OCS status code should be "<ocs_status_code>"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Original file line number Diff line number Diff line change
Expand Up @@ -130,36 +130,46 @@ Feature: Share spaces via link
And for user "Alice" the space "Alice Hansen" should not contain the last created public link


Scenario: space admin removes password of a public link share of a space
Given user "Alice" has created a public link share of the space "share space" with settings:
Scenario Outline: space admin removes password of a public link share of a space
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created a public link share of the space "share space" with settings:
| permissions | 1 |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
| permissions | 1 |
| password | |
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And the OCS status code should be "<ocs_status_code>"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |


Scenario Outline: space admin tries to remove password of a public link share of a space (various permission)
Given user "Alice" has created a public link share of the space "share space" with settings:
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created a public link share of the space "share space" with settings:
| permissions | <permissions> |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
| permissions | <permissions> |
| password | |
Then the HTTP status code should be "200"
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Examples:
| permissions |
| 5 |
| 15 |
| 4 |


Scenario: space manager tries to remove password of a public link share of a space (read permission)
Given user "Alice" has shared a space "share space" with settings:
| ocs_api_version | permissions | http_status_code |
| 1 | 5 | 200 |
| 2 | 5 | 400 |
| 1 | 15 | 200 |
| 2 | 15 | 400 |
| 1 | 4 | 200 |
| 2 | 4 | 400 |


Scenario Outline: space manager tries to remove password of a public link share of a space (read permission)
Given using OCS API version "<ocs_api_version>"
And user "Alice" has shared a space "share space" with settings:
| shareWith | Brian |
| role | manager |
And user "Brian" has created a public link share of the space "share space" with settings:
Expand All @@ -168,13 +178,18 @@ Feature: Share spaces via link
When user "Brian" updates the last public link share using the sharing API with
| permissions | 1 |
| password | |
Then the HTTP status code should be "200"
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "104"
And the OCS status message should be "user is not allowed to delete the password from the public link"
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 403 |


Scenario Outline: space manager tries to remove password of a public link share of a space (various permission)
Given user "Alice" has shared a space "share space" with settings:
Given using OCS API version "<ocs_api_version>"
And user "Alice" has shared a space "share space" with settings:
| shareWith | Brian |
| role | manager |
And user "Brian" has created a public link share of the space "share space" with settings:
Expand All @@ -183,11 +198,14 @@ Feature: Share spaces via link
When user "Brian" updates the last public link share using the sharing API with
| permissions | <permissions> |
| password | |
Then the HTTP status code should be "200"
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Examples:
| permissions |
| 5 |
| 15 |
| 4 |
| ocs_api_version | permissions | http_status_code |
| 1 | 5 | 200 |
| 2 | 5 | 400 |
| 1 | 15 | 200 |
| 2 | 15 | 400 |
| 1 | 4 | 200 |
| 2 | 4 | 400 |
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,29 @@ Feature: changing a public link share


Scenario Outline: normal user tries to remove password of a public link share (change/create permission)
Given user "Alice" has created a public link share with settings
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | <permissions> |
| password | %public% |
When user "Alice" updates the last public link share using the sharing API with
| path | /PARENT |
| permissions | <permissions> |
| password | |
Then the HTTP status code should be "200"
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Examples:
| permissions |
| change |
| create |
| ocs_api_version | permissions | http_status_code |
| 1 | change | 200 |
| 2 | change | 400 |
| 1 | create | 200 |
| 2 | create | 400 |

@issue-7821
Scenario: normal user tries to remove password of a public link (update without sending permissions)
Given user "Alice" has created a public link share with settings
Scenario Outline: normal user tries to remove password of a public link (update without sending permissions)
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | change |
| password | %public% |
Expand All @@ -162,10 +166,15 @@ Feature: changing a public link share
Then the HTTP status code should be "200"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Examples:
| ocs_api_version |
| 1 |
| 2 |


Scenario: administrator removes password of a read-only public link
Given admin has created folder "/PARENT"
Scenario Outline: administrator removes password of a read-only public link
Given using OCS API version "<ocs_api_version>"
And admin has created folder "/PARENT"
And user "admin" has uploaded file "filesForUpload/textfile.txt" to "PARENT/parent.txt"
And user "admin" has created a public link share with settings
| path | /PARENT |
Expand All @@ -176,12 +185,17 @@ Feature: changing a public link share
| permissions | read |
| password | |
Then the HTTP status code should be "200"
And the OCS status code should be "100"
And the OCS status code should be "<ocs_status_code>"
And the public should be able to download file "/parent.txt" from inside the last public link shared folder using the new public WebDAV API with password ""
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |


Scenario Outline: administrator tries to remove password of a public link share (change/create permission)
Given admin has created folder "/PARENT"
Given using OCS API version "<ocs_api_version>"
And admin has created folder "/PARENT"
And user "admin" has created a public link share with settings
| path | /PARENT |
| permissions | <permissions> |
Expand All @@ -190,10 +204,12 @@ Feature: changing a public link share
| path | /PARENT |
| permissions | <permissions> |
| password | |
Then the HTTP status code should be "200"
Then the HTTP status code should be "<http_status_code>"
And the OCS status code should be "400"
And the OCS status message should be "missing required password"
Examples:
| permissions |
| change |
| create |
| ocs_api_version | permissions | http_status_code |
| 1 | change | 200 |
| 2 | change | 400 |
| 1 | create | 200 |
| 2 | create | 400 |

0 comments on commit 6beaa0d

Please sign in to comment.