Skip to content

Commit

Permalink
Added Then steps to improve checks in tests for apiFavorites suite
Browse files Browse the repository at this point in the history
  • Loading branch information
grgprarup committed Feb 22, 2022
1 parent afae230 commit 261ac05
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
25 changes: 15 additions & 10 deletions tests/acceptance/features/apiFavorites/favorites.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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_version> 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 |
Expand All @@ -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 |
Expand All @@ -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_version> 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 |
Expand Down Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand All @@ -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 |
Expand All @@ -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 |
Expand All @@ -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 |
Expand Down

0 comments on commit 261ac05

Please sign in to comment.