From 261ac0523568ad75c9594f90c7af44ac676d306a Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Mon, 21 Feb 2022 14:03:03 +0545 Subject: [PATCH] Added Then steps to improve checks in tests for apiFavorites suite --- .../features/apiFavorites/favorites.feature | 25 +++++++++++-------- .../favoritesOc10Issue33840.feature | 6 +++-- .../favoritesSharingToShares.feature | 14 ++++++++--- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/tests/acceptance/features/apiFavorites/favorites.feature b/tests/acceptance/features/apiFavorites/favorites.feature index 80b37741164e..b6d2e1e410d5 100644 --- a/tests/acceptance/features/apiFavorites/favorites.feature +++ b/tests/acceptance/features/apiFavorites/favorites.feature @@ -22,7 +22,8 @@ Feature: favorite When user "Alice" gets the following properties of folder "/FOLDER" using the WebDAV API | propertyName | | oc:favorite | - Then the single response should contain a property "oc:favorite" with value "1" + Then the HTTP status code should be "207" + And the single response should contain a property "oc:favorite" with value "1" Examples: | dav_version | | old | @@ -34,16 +35,17 @@ Feature: favorite | spaces | @issue-ocis-reva-276 - Scenario Outline: Favorite and unfavorite a folder + Scenario Outline: Unfavorite a folder Given using DAV path - When user "Alice" favorites element "/FOLDER" using the WebDAV API - And user "Alice" unfavorites element "/FOLDER" using the WebDAV API + And user "Alice" has favorited element "/FOLDER" + When user "Alice" unfavorites element "/FOLDER" using the WebDAV API Then the HTTP status code should be "207" And as user "Alice" folder "/FOLDER" should not be favorited When user "Alice" gets the following properties of folder "/FOLDER" using the WebDAV API | propertyName | | oc:favorite | - Then the single response should contain a property "oc:favorite" with value "0" + Then the HTTP status code should be "207" + And the single response should contain a property "oc:favorite" with value "0" Examples: | dav_version | | old | @@ -63,7 +65,8 @@ Feature: favorite When user "Alice" gets the following properties of file "/textfile0.txt" using the WebDAV API | propertyName | | oc:favorite | - Then the single response should contain a property "oc:favorite" with value "1" + Then the HTTP status code should be "207" + And the single response should contain a property "oc:favorite" with value "1" Examples: | dav_version | | old | @@ -75,16 +78,17 @@ Feature: favorite | spaces | @smokeTest @issue-ocis-reva-276 - Scenario Outline: Favorite and unfavorite a file + Scenario Outline: Unfavorite a file Given using DAV path - When user "Alice" favorites element "/textfile0.txt" using the WebDAV API - And user "Alice" unfavorites element "/textfile0.txt" using the WebDAV API + And user "Alice" has favorited element "/textfile0.txt" + When user "Alice" unfavorites element "/textfile0.txt" using the WebDAV API Then the HTTP status code should be "207" And as user "Alice" file "/textfile0.txt" should not be favorited When user "Alice" gets the following properties of file "/textfile0.txt" using the WebDAV API | propertyName | | oc:favorite | - Then the single response should contain a property "oc:favorite" with value "0" + Then the HTTP status code should be "207" + And the single response should contain a property "oc:favorite" with value "0" Examples: | dav_version | | old | @@ -229,6 +233,7 @@ Feature: favorite And user "Alice" has shared file "/favoriteFile.txt" with user "Brian" When user "Alice" favorites element "/favoriteFile.txt" using the WebDAV API Then the HTTP status code should be "207" + And as user "Alice" file "/favoriteFile.txt" should be favorited And as user "Brian" file "/favoriteFile.txt" should not be favorited Examples: | dav_version | diff --git a/tests/acceptance/features/apiFavorites/favoritesOc10Issue33840.feature b/tests/acceptance/features/apiFavorites/favoritesOc10Issue33840.feature index d512b09009cb..2262639eb468 100644 --- a/tests/acceptance/features/apiFavorites/favoritesOc10Issue33840.feature +++ b/tests/acceptance/features/apiFavorites/favoritesOc10Issue33840.feature @@ -23,7 +23,8 @@ Feature: current oC10 behavior for issue-33840 And user "Alice" has favorited element "/textfile4.txt" When user "Alice" lists the favorites and limits the result to 3 elements using the WebDAV API #Then the search result should contain any "3" of these entries: - Then the search result should contain any "0" of these entries: + Then the HTTP status code should be "207" + And the search result should contain any "0" of these entries: | /textfile0.txt | | /textfile1.txt | | /textfile2.txt | @@ -52,7 +53,8 @@ Feature: current oC10 behavior for issue-33840 And user "Alice" has favorited element "/subfolder/textfile5.txt" When user "Alice" lists the favorites and limits the result to 3 elements using the WebDAV API #Then the search result should contain any "3" of these entries: - Then the search result should contain any "0" of these entries: + Then the HTTP status code should be "207" + And the search result should contain any "0" of these entries: | /subfolder/textfile0.txt | | /subfolder/textfile1.txt | | /subfolder/textfile2.txt | diff --git a/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature b/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature index 402971a0d5d9..377a530c289c 100644 --- a/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature +++ b/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature @@ -15,7 +15,8 @@ Feature: favorite And user "Alice" has shared folder "/PARENT" with user "Brian" And user "Brian" has accepted share "/PARENT" offered by user "Alice" When user "Brian" favorites element "/Shares/PARENT/parent.txt" using the WebDAV API - Then as user "Brian" file "/Shares/PARENT/parent.txt" should be favorited + Then the HTTP status code should be "207" + And as user "Brian" file "/Shares/PARENT/parent.txt" should be favorited Examples: | dav_version | | old | @@ -34,7 +35,8 @@ Feature: favorite And user "Alice" has shared folder "/PARENT" with user "Brian" And user "Brian" has accepted share "/PARENT" offered by user "Alice" When user "Brian" favorites element "/Shares/PARENT/sub-folder" using the WebDAV API - Then as user "Brian" folder "/Shares/PARENT/sub-folder" should be favorited + Then the HTTP status code should be "207" + And as user "Brian" folder "/Shares/PARENT/sub-folder" should be favorited Examples: | dav_version | | old | @@ -52,7 +54,8 @@ Feature: favorite And user "Alice" has shared folder "/PARENT" with user "Brian" And user "Brian" has accepted share "/PARENT" offered by user "Alice" When user "Brian" favorites element "/Shares/PARENT" using the WebDAV API - Then as user "Brian" folder "/Shares/PARENT" should be favorited + Then the HTTP status code should be "207" + And as user "Brian" folder "/Shares/PARENT" should be favorited Examples: | dav_version | | old | @@ -71,7 +74,9 @@ Feature: favorite And user "Brian" has accepted share "/PARENT" offered by user "Alice" And user "Brian" has favorited element "/Shares/PARENT/parent.txt" When user "Brian" moves file "/Shares/PARENT/parent.txt" to "/taken_out.txt" using the WebDAV API - Then as user "Brian" file "/taken_out.txt" should be favorited + Then the HTTP status code should be "201" + And as "Brian" file "/taken_out.txt" should exist + And as user "Brian" file "/taken_out.txt" should be favorited Examples: | dav_version | | old | @@ -90,6 +95,7 @@ Feature: favorite And user "Brian" has accepted share "/parent.txt" offered by user "Alice" When user "Brian" favorites element "/Shares/parent.txt" using the WebDAV API Then the HTTP status code should be "207" + And as user "Brian" file "/Shares/parent.txt" should be favorited And as user "Alice" file "/PARENT/parent.txt" should not be favorited Examples: | dav_version |