From 4dec9388855eef09d3832b37037d98f4c4881a7f Mon Sep 17 00:00:00 2001 From: "sagargurung1001@gmail.com" Date: Wed, 27 Apr 2022 16:36:55 +0545 Subject: [PATCH] Improve then step for suite apiShareManagementToShare --- .../acceptShares.feature | 112 ++++++++++-------- .../acceptSharesToSharesFolder.feature | 4 +- .../mergeShare.feature | 50 ++++++-- .../moveReceivedShare.feature | 29 +++-- .../moveShareInsideAnotherShare.feature | 8 +- .../acceptance/features/bootstrap/WebDav.php | 1 + 6 files changed, 125 insertions(+), 79 deletions(-) diff --git a/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature b/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature index 656298983078..343b942ed34b 100644 --- a/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature +++ b/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature @@ -33,8 +33,8 @@ Feature: accept/decline shares coming from internal users And user "Carol" has uploaded file "filesForUpload/textfile.txt" to "textfile0.txt" When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API And user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And user "Brian" should see the following elements | /FOLDER/ | | /PARENT/ | @@ -73,8 +73,8 @@ Feature: accept/decline shares coming from internal users Scenario Outline: share a file & folder with another internal user when auto accept is disabled When user "Alice" shares folder "/PARENT" with user "Brian" using the sharing API And user "Alice" shares file "/textfile0.txt" with user "Brian" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And user "Brian" should see the following elements | /FOLDER/ | | /PARENT/ | @@ -102,11 +102,9 @@ Feature: accept/decline shares coming from internal users Given user "Alice" has shared folder "/PARENT" with user "Brian" And user "Alice" has shared file "/textfile0.txt" with user "Brian" When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" And user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - And the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And the fields of the last response to user "Alice" sharing with user "Brian" should include | id | A_STRING | | share_type | user | @@ -145,11 +143,9 @@ Feature: accept/decline shares coming from internal users And user "Alice" has shared folder "/PARENT" with user "Brian" And user "Alice" has shared file "/textfile0.txt" with user "Brian" When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" And user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - And the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And the fields of the last response to user "Alice" sharing with user "Brian" should include | id | A_STRING | | share_type | user | @@ -208,8 +204,8 @@ Feature: accept/decline shares coming from internal users And user "Alice" has shared file "/textfile0.txt" with user "Brian" When user "Brian" declines share "/PARENT" offered by user "Alice" using the sharing API And user "Brian" declines share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And user "Brian" should see the following elements | /FOLDER/ | | /PARENT/ | @@ -239,11 +235,9 @@ Feature: accept/decline shares coming from internal users And user "Brian" has accepted share "/PARENT" offered by user "Alice" And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice" When user "Brian" declines share "/Shares/PARENT" offered by user "Alice" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" And user "Brian" declines share "/Shares/textfile0.txt" offered by user "Alice" using the sharing API - And the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And user "Brian" should not see the following elements | /Shares/PARENT/ | | /Shares/PARENT/parent.txt | @@ -268,18 +262,17 @@ Feature: accept/decline shares coming from internal users And user "Alice" has shared file "/textfile0.txt" with user "Brian" When user "Alice" deletes folder "/PARENT" using the WebDAV API And user "Alice" deletes file "/textfile0.txt" using the WebDAV API - Then the sharing API should report that no shares are shared with user "Brian" + Then the HTTP status code of responses on all endpoints should be "204" + And the sharing API should report that no shares are shared with user "Brian" Scenario Outline: only one user in a group accepts a share Given user "Alice" has shared folder "/PARENT" with group "grp1" And user "Alice" has shared file "/textfile0.txt" with group "grp1" When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" And user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - And the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And user "Carol" should not see the following elements | /Shares/PARENT/ | | /Shares/PARENT/parent.txt | @@ -316,11 +309,9 @@ Feature: accept/decline shares coming from internal users And user "Alice" has shared folder "/shared" with user "Carol" And user "Brian" has shared folder "/shared" with user "Carol" When user "Carol" accepts share "/shared" offered by user "Brian" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" And user "Carol" accepts share "/shared" offered by user "Alice" using the sharing API - And the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And user "Carol" should see the following elements | /Shares/shared/Brian/ | | /Shares/shared (2)/Alice/ | @@ -360,7 +351,9 @@ Feature: accept/decline shares coming from internal users And user "Brian" shares file "/testfile.txt" with user "Carol" using the sharing API And user "Carol" accepts share "/testfile.txt" offered by user "Brian" using the sharing API And user "Carol" accepts share "" offered by user "Alice" using the sharing API - Then the sharing API should report to user "Carol" that these shares are in the accepted state + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And the sharing API should report to user "Carol" that these shares are in the accepted state | path | | /Shares/testfile (2).txt | | /Shares/testfile (2) (2).txt | @@ -396,7 +389,9 @@ Feature: accept/decline shares coming from internal users And user "Alice" accepts share "/PARENT" offered by user "David" using the sharing API And user "Alice" accepts share "" offered by user "Carol" using the sharing API And user "Alice" accepts share "" offered by user "Brian" using the sharing API - Then the sharing API should report to user "Alice" that these shares are in the accepted state + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And the sharing API should report to user "Alice" that these shares are in the accepted state | path | uid_owner | | /Shares/PARENT (2)/ | David | | /Shares/PARENT (2) (2)/ | Carol | @@ -417,11 +412,11 @@ Feature: accept/decline shares coming from internal users And user "Alice" has uploaded file with content "uploaded content" to "/FOLDER/abc.txt" When user "Alice" shares folder "/PARENT" with user "Brian" using the sharing API And user "Alice" shares folder "/FOLDER" with user "Brian" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" - When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API + And user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API And user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then user "Brian" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /FOLDER/ | | /PARENT/ | | /Shares/PARENT/ | @@ -442,13 +437,13 @@ Feature: accept/decline shares coming from internal users And user "Carol" has created folder "FOLDER" When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API And user "Alice" shares folder "/FOLDER" with group "grp1" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" When user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API And user "Brian" accepts share "/FOLDER" offered by user "Alice" using the sharing API And user "Carol" accepts share "/PARENT" offered by user "Alice" using the sharing API And user "Carol" accepts share "/FOLDER" offered by user "Alice" using the sharing API - Then user "Brian" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /FOLDER/ | | /PARENT/ | | /Shares/PARENT/ | @@ -481,13 +476,13 @@ Feature: accept/decline shares coming from internal users And user "Carol" has uploaded file "filesForUpload/textfile.txt" to "textfile1.txt" When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API And user "Alice" shares file "/textfile1.txt" with group "grp1" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API And user "Brian" accepts share "/textfile1.txt" offered by user "Alice" using the sharing API And user "Carol" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API And user "Carol" accepts share "/textfile1.txt" offered by user "Alice" using the sharing API - Then user "Brian" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /textfile0.txt | | /textfile1.txt | | /Shares/textfile0.txt | @@ -502,8 +497,8 @@ Feature: accept/decline shares coming from internal users Scenario: user shares resource with matching resource-name with another user when auto accept is disabled When user "Alice" shares folder "/PARENT" with user "Brian" using the sharing API And user "Alice" shares file "/textfile0.txt" with user "Brian" using the sharing API - Then the OCS status code should be "100" - And the HTTP status code should be "200" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" And user "Brian" should see the following elements | /PARENT/ | | /textfile0.txt | @@ -512,7 +507,9 @@ Feature: accept/decline shares coming from internal users | /Shares/PARENT/ | When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API And user "Brian" accepts share "/PARENT" offered by user "Alice" using the sharing API - Then user "Brian" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /PARENT/ | | /textfile0.txt | | /Shares/PARENT/ | @@ -533,11 +530,13 @@ Feature: accept/decline shares coming from internal users But user "Carol" should not see the following elements | /Shares/textfile0.txt | When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then user "Brian" should see the following elements + When user "Carol" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /textfile0.txt | | /Shares/textfile0.txt | - When user "Carol" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then user "Carol" should see the following elements + And user "Carol" should see the following elements | /textfile0.txt | | /Shares/textfile0.txt | @@ -549,7 +548,9 @@ Feature: accept/decline shares coming from internal users And user "Alice" has uploaded file with content "uploaded content" to "/PARENT/abc.txt" When user "Alice" shares folder "/PARENT" with user "David" using the sharing API And user "David" accepts share "/PARENT" offered by user "Alice" using the sharing API - Then user "David" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "David" should see the following elements | /Shares/PARENT/ | | /Shares/PARENT/abc.txt | | /FOLDER/ | @@ -590,7 +591,8 @@ Feature: accept/decline shares coming from internal users And user "Alice" has shared file "/toShareFile.txt" with user "Brian" And user "Brian" has accepted share "/toShareFile.txt" offered by user "Alice" When user "Alice" restores version index "1" of file "/toShareFile.txt" using the WebDAV API - Then the content of file "/toShareFile.txt" for user "Alice" should be "Test Content." + Then the HTTP status code should be "200" + And the content of file "/toShareFile.txt" for user "Alice" should be "Test Content." And the content of file "/Shares/toShareFile.txt" for user "Brian" should be "Test Content." @skipOnOcV10.6 @skipOnOcV10.7 @skipOnOcV10.8.0 @issue-ocis-2131 @@ -624,7 +626,9 @@ Feature: accept/decline shares coming from internal users | /PARENT | | /PaRent | | /PARENT.txt | - Then user "Brian" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /PARENT/ | | /Shares/PARENT/ | | /Shares/PaRent/ | @@ -642,7 +646,9 @@ Feature: accept/decline shares coming from internal users | /PARENT | | /PARENT.txt | | /parent.txt | - Then user "Brian" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /PARENT/ | | /Shares/PARENT/ | | /Shares/PARENT (2)/ | @@ -683,7 +689,9 @@ Feature: accept/decline shares coming from internal users | /PARENT | | /PaRent | | /PARENT.txt | - Then user "Carol" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Carol" should see the following elements | /PARENT/ | | /Shares/PARENT/ | | /Shares/PaRent/ | @@ -700,7 +708,9 @@ Feature: accept/decline shares coming from internal users | /PARENT | | /PARENT.txt | | /parent.txt | - Then user "Carol" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Carol" should see the following elements | /PARENT/ | | /Shares/PARENT/ | | /Shares/PARENT (2)/ | diff --git a/tests/acceptance/features/apiShareManagementToShares/acceptSharesToSharesFolder.feature b/tests/acceptance/features/apiShareManagementToShares/acceptSharesToSharesFolder.feature index 388710506afd..fe5f07820d94 100644 --- a/tests/acceptance/features/apiShareManagementToShares/acceptSharesToSharesFolder.feature +++ b/tests/acceptance/features/apiShareManagementToShares/acceptSharesToSharesFolder.feature @@ -18,7 +18,9 @@ Feature: accept/decline shares coming from internal users to the Shares folder Given user "Alice" has uploaded file with content "ownCloud test text file 0" to "textfile0.txt" And user "Alice" has shared file "/textfile0.txt" with user "Brian" When user "Brian" accepts share "/textfile0.txt" offered by user "Alice" using the sharing API - Then the content of file "/Shares/textfile0.txt" for user "Brian" should be "ownCloud test text file 0" + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And the content of file "/Shares/textfile0.txt" for user "Brian" should be "ownCloud test text file 0" Scenario: When accepting a share of a folder, the received folder is accessible Given user "Alice" has created folder "/PARENT" diff --git a/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature b/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature index 372af90f40bb..c5a4142934f8 100644 --- a/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature +++ b/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature @@ -18,7 +18,9 @@ Feature: sharing When user "Alice" shares folder "/merge-test-outside" with group "grp1" using the sharing API And user "Alice" shares folder "/merge-test-outside" with user "Brian" using the sharing API And user "Brian" accepts share "/merge-test-outside" offered by user "Alice" using the sharing API - Then as "Brian" folder "/Shares/merge-test-outside" should exist + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as "Brian" folder "/Shares/merge-test-outside" should exist And as "Brian" folder "/Shares/merge-test-outside (2)" should not exist Scenario: Merging shares for recipient when shared from outside with group and member with different permissions @@ -26,7 +28,9 @@ Feature: sharing When user "Alice" shares folder "/merge-test-outside-perms" with group "grp1" with permissions "read" using the sharing API And user "Alice" shares folder "/merge-test-outside-perms" with user "Brian" with permissions "all" using the sharing API And user "Brian" accepts share "/merge-test-outside-perms" offered by user "Alice" using the sharing API - Then as user "Brian" folder "/Shares/merge-test-outside-perms" should contain a property "oc:permissions" with value "SRDNVCK" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as user "Brian" folder "/Shares/merge-test-outside-perms" should contain a property "oc:permissions" with value "SRDNVCK" And as "Brian" folder "/Shares/merge-test-outside-perms (2)" should not exist Scenario: Merging shares for recipient when shared from outside with two groups @@ -36,7 +40,9 @@ Feature: sharing When user "Alice" shares folder "/merge-test-outside-twogroups" with group "grp1" using the sharing API And user "Alice" shares folder "/merge-test-outside-twogroups" with group "grp2" using the sharing API And user "Brian" accepts share "/merge-test-outside-twogroups" offered by user "Alice" using the sharing API - Then as "Brian" folder "/Shares/merge-test-outside-twogroups" should exist + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as "Brian" folder "/Shares/merge-test-outside-twogroups" should exist And as "Brian" folder "/Shares/merge-test-outside-twogroups (2)" should not exist Scenario: Merging shares for recipient when shared from outside with two groups with different permissions @@ -46,7 +52,9 @@ Feature: sharing When user "Alice" shares folder "/merge-test-outside-twogroups-perms" with group "grp1" with permissions "read" using the sharing API And user "Alice" shares folder "/merge-test-outside-twogroups-perms" with group "grp2" with permissions "all" using the sharing API And user "Brian" accepts share "/merge-test-outside-twogroups-perms" offered by user "Alice" using the sharing API - Then as user "Brian" folder "/Shares/merge-test-outside-twogroups-perms" should contain a property "oc:permissions" with value "SRDNVCK" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as user "Brian" folder "/Shares/merge-test-outside-twogroups-perms" should contain a property "oc:permissions" with value "SRDNVCK" And as "Brian" folder "/Shares/merge-test-outside-twogroups-perms (2)" should not exist Scenario: Merging shares for recipient when shared from outside with two groups and member @@ -57,13 +65,17 @@ Feature: sharing And user "Alice" shares folder "/merge-test-outside-twogroups-member-perms" with group "grp2" with permissions "all" using the sharing API And user "Alice" shares folder "/merge-test-outside-twogroups-member-perms" with user "Brian" with permissions "read" using the sharing API And user "Brian" accepts share "/merge-test-outside-twogroups-member-perms" offered by user "Alice" using the sharing API - Then as user "Brian" folder "/Shares/merge-test-outside-twogroups-member-perms" should contain a property "oc:permissions" with value "SRDNVCK" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as user "Brian" folder "/Shares/merge-test-outside-twogroups-member-perms" should contain a property "oc:permissions" with value "SRDNVCK" And as "Brian" folder "/Shares/merge-test-outside-twogroups-member-perms (2)" should not exist Scenario: Merging shares for recipient when shared from inside with group Given user "Brian" has created folder "/merge-test-inside-group" When user "Brian" shares folder "/merge-test-inside-group" with group "grp1" using the sharing API - Then as "Brian" folder "/merge-test-inside-group" should exist + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And as "Brian" folder "/merge-test-inside-group" should exist And as "Brian" folder "/Shares/merge-test-inside-group" should not exist Scenario: Merging shares for recipient when shared from inside with two groups @@ -72,7 +84,9 @@ Feature: sharing And user "Brian" has created folder "/merge-test-inside-twogroups" When user "Brian" shares folder "/merge-test-inside-twogroups" with group "grp1" using the sharing API And user "Brian" shares folder "/merge-test-inside-twogroups" with group "grp2" using the sharing API - Then as "Brian" folder "/merge-test-inside-twogroups" should exist + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as "Brian" folder "/merge-test-inside-twogroups" should exist And as "Brian" folder "/Shares/merge-test-inside-twogroups" should not exist And as "Brian" folder "/Shares/merge-test-inside-twogroups (2)" should not exist @@ -82,7 +96,9 @@ Feature: sharing And user "Brian" has created folder "/merge-test-inside-twogroups-perms" When user "Brian" shares folder "/merge-test-inside-twogroups-perms" with group "grp1" using the sharing API And user "Brian" shares folder "/merge-test-inside-twogroups-perms" with group "grp2" using the sharing API - Then as user "Brian" folder "/merge-test-inside-twogroups-perms" should contain a property "oc:permissions" with value "RDNVCK" or with value "RMDNVCK" + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as user "Brian" folder "/merge-test-inside-twogroups-perms" should contain a property "oc:permissions" with value "RDNVCK" or with value "RMDNVCK" And as "Brian" folder "/Shares/merge-test-inside-twogroups-perms" should not exist And as "Brian" folder "/Shares/merge-test-inside-twogroups-perms (2)" should not exist @@ -92,13 +108,17 @@ Feature: sharing When user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare" with group "grp1" using the sharing API And user "Brian" accepts share "/merge-test-outside-groups-renamebeforesecondshare" offered by user "Alice" using the sharing API And user "Brian" moves folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed" using the WebDAV API - Then as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should not exist + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on each endpoint should be "200, 200, 201" respectively + And as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should not exist But as "Brian" folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" should exist # Section 2: Brian receives and accepts the user share from Alice. Brian now has 2 shares of the same folder owned by Alice # The server "merges" the 2 shares and presents them to Brian as a single folder inside the "Shares" folder - And user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare" with user "Brian" using the sharing API + When user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare" with user "Brian" using the sharing API And user "Brian" accepts share "/merge-test-outside-groups-renamebeforesecondshare" offered by user "Alice" using the sharing API - Then as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should exist + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should exist But as "Brian" folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" should not exist Scenario: Merging shares for recipient when shared from outside with user then group and recipient renames in between @@ -107,11 +127,15 @@ Feature: sharing When user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare" with user "Brian" using the sharing API And user "Brian" accepts share "/merge-test-outside-groups-renamebeforesecondshare" offered by user "Alice" using the sharing API And user "Brian" moves folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed" using the WebDAV API - Then as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should not exist + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on each endpoint should be "200, 200, 201" respectively + And as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should not exist But as "Brian" folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" should exist # Section 2: Brian receives and accepts the group share from Alice. Brian now has 2 shares of the same folder owned by Alice # The server "merges" the 2 shares and presents them to Brian as a single folder inside the "Shares" folder When user "Alice" shares folder "/merge-test-outside-groups-renamebeforesecondshare" with group "grp1" using the sharing API And user "Brian" accepts share "/merge-test-outside-groups-renamebeforesecondshare" offered by user "Alice" using the sharing API - Then as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should exist + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And as "Brian" folder "/Shares/merge-test-outside-groups-renamebeforesecondshare" should exist But as "Brian" folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" should not exist diff --git a/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature b/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature index 0642e8a24d62..50b03f6fe557 100644 --- a/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature +++ b/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature @@ -23,7 +23,9 @@ Feature: sharing And user "Brian" creates folder "/myFOLDER" using the WebDAV API And user "Brian" moves folder "/Shares/TMP" to "/myFOLDER/myTMP" using the WebDAV API And the administrator deletes user "Carol" using the provisioning API - Then user "Brian" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /myFOLDER/myTMP/ | @@ -37,7 +39,9 @@ Feature: sharing And user "Carol" accepts share "/TMP" offered by user "Alice" using the sharing API And user "Brian" moves folder "/Shares/TMP" to "/Shares/new" using the WebDAV API And the administrator deletes user "Carol" using the provisioning API - Then user "Brian" should see the following elements + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on all endpoints should be "200" + And user "Brian" should see the following elements | /Shares/new/| @issue-ocis-2141 @notToImplementOnOCIS @@ -48,7 +52,8 @@ Feature: sharing And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" And user "Carol" has accepted share "/sharefile.txt" offered by user "Alice" When user "Carol" moves file "/Shares/sharefile.txt" to "/renamedsharefile.txt" using the WebDAV API - Then as "Carol" file "/renamedsharefile.txt" should exist + Then the HTTP status code should be "201" + And as "Carol" file "/renamedsharefile.txt" should exist And as "Alice" file "/sharefile.txt" should exist And as "Brian" file "/Shares/sharefile.txt" should exist @@ -60,7 +65,8 @@ Feature: sharing And user "Brian" has accepted share "/sharefile.txt" offered by user "Alice" And user "Carol" has accepted share "/sharefile.txt" offered by user "Alice" When user "Carol" moves file "/Shares/sharefile.txt" to "/Shares/renamedsharefile.txt" using the WebDAV API - Then as "Carol" file "/Shares/renamedsharefile.txt" should exist + Then the HTTP status code should be "201" + And as "Carol" file "/Shares/renamedsharefile.txt" should exist And as "Alice" file "/sharefile.txt" should exist And as "Brian" file "/Shares/sharefile.txt" should exist @@ -73,7 +79,8 @@ Feature: sharing And user "Carol" has accepted share "/sharefile.txt" offered by user "Alice" And user "Carol" has created folder "newfolder" When user "Carol" moves file "/Shares/sharefile.txt" to "/newfolder/sharefile.txt" using the WebDAV API - Then as "Carol" file "/newfolder/sharefile.txt" should exist + Then the HTTP status code should be "201" + And as "Carol" file "/newfolder/sharefile.txt" should exist And as "Alice" file "/sharefile.txt" should exist And as "Brian" file "/Shares/sharefile.txt" should exist @@ -88,12 +95,14 @@ Feature: sharing And user "Alice" has shared folder "" with user "Brian" And user "Brian" has accepted share "/" offered by user "Alice" When user "Brian" moves folder "" to "/Shares//" using the WebDAV API - Then as "Alice" folder "/" should exist - And as "Brian" folder "/Shares//" should exist - When user "Alice" shares folder "" with group "grp1" using the sharing API + And user "Alice" shares folder "" with group "grp1" using the sharing API And user "Carol" accepts share "/" offered by user "Alice" using the sharing API And user "Carol" moves folder "/" to "/Shares//" using the WebDAV API - Then as "Alice" folder "/" should exist + Then the OCS status code of responses on all endpoints should be "100" + And the HTTP status code of responses on each endpoint should be "201, 200, 200, 201" respectively + And as "Alice" folder "/" should exist + And as "Brian" folder "/Shares//" should exist + And as "Alice" folder "/" should exist And as "Carol" folder "/Shares//" should exist Examples: | sharer_folder | group_folder | receiver_folder | @@ -360,7 +369,7 @@ Feature: sharing And user "Brian" has accepted share "/folderToShare" offered by user "Alice" When user "Brian" moves file "/Shares/folderToShare/fileToShare1.txt" to "/FOLDER/fileToShare1.txt" using the WebDAV API And user "Brian" moves file "/Shares/folderToShare/fileToShare2.txt" to "/FOLDER/fileToShare2.txt" using the WebDAV API - Then the HTTP status code should be "201" + Then the HTTP status code of responses on all endpoints should be "201" And as "Brian" file "/FOLDER/fileToShare1.txt" should exist And as "Brian" file "/FOLDER/fileToShare2.txt" should exist But as "Alice" file "/folderToShare/fileToShare1.txt" should not exist diff --git a/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature b/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature index 9669280642ea..1a9528e3b633 100644 --- a/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature +++ b/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature @@ -58,7 +58,7 @@ Feature: moving a share inside another share And user "Brian" has uploaded file with content "local text" to "/localFolder/localFile.txt" When user "Brian" moves folder "Shares/folderB" to "localFolder/folderB" using the WebDAV API And user "Brian" moves folder "localFolder" to "Shares/folderA/localFolder" using the WebDAV API - Then the HTTP status code should be "201" + Then the HTTP status code of responses on all endpoints should be "201" And as "Alice" folder "/folderA/localFolder" should exist And as "Brian" folder "/Shares/folderA/localFolder" should exist And as "Alice" file "/folderA/localFolder/localFile.txt" should exist @@ -75,7 +75,7 @@ Feature: moving a share inside another share And user "Brian" has uploaded file with content "local text" to "/localFolder/localFile.txt" When user "Brian" moves folder "Shares/folderB" to "localFolder/folderB" using the WebDAV API And user "Brian" moves folder "localFolder/folderB" to "Shares/folderA/folderB" using the WebDAV API - Then the HTTP status code should be "403" + Then the HTTP status code of responses on each endpoint should be "201, 403" respectively And as "Alice" file "/folderB/fileB.txt" should exist And as "Brian" folder "/localFolder/folderB" should exist And as "Brian" file "/localFolder/folderB/fileB.txt" should exist @@ -85,9 +85,9 @@ Feature: moving a share inside another share Scenario: share receiver moves a local folder inside a received share (local folder does not have a share in it) Given user "Brian" has created folder "localFolder" - Given user "Brian" has created folder "localFolder/subFolder" + And user "Brian" has created folder "localFolder/subFolder" And user "Brian" has uploaded file with content "local text" to "/localFolder/localFile.txt" - And user "Brian" moves folder "localFolder" to "Shares/folderA/localFolder" using the WebDAV API + When user "Brian" moves folder "localFolder" to "Shares/folderA/localFolder" using the WebDAV API Then the HTTP status code should be "201" And as "Alice" folder "/folderA/localFolder" should exist And as "Brian" folder "/Shares/folderA/localFolder" should exist diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index a0e8cc01efeb..d59c5a450c9c 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -2495,6 +2495,7 @@ public function theHTTPStatusCodeOfResponsesOnEachEndpointShouldBe(string $statu 'Responses did not return expected HTTP status code' ); } + $this->emptyLastHTTPStatusCodesArray(); } else { throw new Exception( 'Expected HTTP status codes: "' . \implode(',', $statusCodes) .