From 6beaa0d2b8ddb12a90694ced248e38d96bc8bc6f Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Mon, 4 Dec 2023 16:39:38 +0545 Subject: [PATCH] tests: update tests related to deletion of public link password to use ocsv2 as well --- .../apiSpacesShares/shareOperations.feature | 20 +++++-- .../shareSpacesViaLink.feature | 58 ++++++++++++------- .../changingPublicLinkShare.feature | 46 ++++++++++----- 3 files changed, 83 insertions(+), 41 deletions(-) diff --git a/tests/acceptance/features/apiSpacesShares/shareOperations.feature b/tests/acceptance/features/apiSpacesShares/shareOperations.feature index fea00f4591d..4f59d41923c 100644 --- a/tests/acceptance/features/apiSpacesShares/shareOperations.feature +++ b/tests/acceptance/features/apiSpacesShares/shareOperations.feature @@ -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 "" 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 @@ -365,17 +366,20 @@ Feature: sharing | path | /FOLDER | | permissions | | | password | | - Then the HTTP status code should be "200" + Then the HTTP status code should be "" 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 "" 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 @@ -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 "" + Examples: + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | diff --git a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature index f762a767bcd..5caae637fc1 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpacesViaLink.feature @@ -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 "" + 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 "" + 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 "" + And user "Alice" has created a public link share of the space "share space" with settings: | permissions | | | password | %public% | When user "Alice" updates the last public link share using the sharing API with | permissions | | | password | | - Then the HTTP status code should be "200" + Then the HTTP status code should be "" 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 "" + 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: @@ -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 "" 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 "" + 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: @@ -183,11 +198,14 @@ Feature: Share spaces via link When user "Brian" updates the last public link share using the sharing API with | permissions | | | password | | - Then the HTTP status code should be "200" + Then the HTTP status code should be "" 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 | diff --git a/tests/acceptance/features/coreApiSharePublicLink1/changingPublicLinkShare.feature b/tests/acceptance/features/coreApiSharePublicLink1/changingPublicLinkShare.feature index 74296b42abd..1c5fc3516db 100644 --- a/tests/acceptance/features/coreApiSharePublicLink1/changingPublicLinkShare.feature +++ b/tests/acceptance/features/coreApiSharePublicLink1/changingPublicLinkShare.feature @@ -134,7 +134,8 @@ 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 "" + And user "Alice" has created a public link share with settings | path | /PARENT | | permissions | | | password | %public% | @@ -142,17 +143,20 @@ Feature: changing a public link share | path | /PARENT | | permissions | | | password | | - Then the HTTP status code should be "200" + Then the HTTP status code should be "" 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 "" + And user "Alice" has created a public link share with settings | path | /PARENT | | permissions | change | | password | %public% | @@ -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 "" + 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 | @@ -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 "" 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 "" + And admin has created folder "/PARENT" And user "admin" has created a public link share with settings | path | /PARENT | | permissions | | @@ -190,10 +204,12 @@ Feature: changing a public link share | path | /PARENT | | permissions | | | password | | - Then the HTTP status code should be "200" + Then the HTTP status code should be "" 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 |