favorites.feature 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. # SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. Feature: favorite
  5. Background:
  6. Given using api version "1"
  7. Scenario: Favorite a folder
  8. Given using old dav path
  9. And As an "admin"
  10. And user "user0" exists
  11. When user "user0" favorites element "/FOLDER"
  12. Then as "user0" gets properties of folder "/FOLDER" with
  13. |{http://owncloud.org/ns}favorite|
  14. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
  15. Scenario: Favorite and unfavorite a folder
  16. Given using old dav path
  17. And As an "admin"
  18. And user "user0" exists
  19. When user "user0" favorites element "/FOLDER"
  20. And user "user0" unfavorites element "/FOLDER"
  21. Then as "user0" gets properties of folder "/FOLDER" with
  22. |{http://owncloud.org/ns}favorite|
  23. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "0"
  24. Scenario: Favorite a file
  25. Given using old dav path
  26. And As an "admin"
  27. And user "user0" exists
  28. When user "user0" favorites element "/textfile0.txt"
  29. Then as "user0" gets properties of file "/textfile0.txt" with
  30. |{http://owncloud.org/ns}favorite|
  31. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
  32. Scenario: Favorite and unfavorite a file
  33. Given using old dav path
  34. And As an "admin"
  35. And user "user0" exists
  36. When user "user0" favorites element "/textfile0.txt"
  37. And user "user0" unfavorites element "/textfile0.txt"
  38. Then as "user0" gets properties of file "/textfile0.txt" with
  39. |{http://owncloud.org/ns}favorite|
  40. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "0"
  41. Scenario: Favorite a folder new endpoint
  42. Given using new dav path
  43. And As an "admin"
  44. And user "user0" exists
  45. When user "user0" favorites element "/FOLDER"
  46. Then as "user0" gets properties of folder "/FOLDER" with
  47. |{http://owncloud.org/ns}favorite|
  48. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
  49. Scenario: Favorite and unfavorite a folder new endpoint
  50. Given using new dav path
  51. And As an "admin"
  52. And user "user0" exists
  53. When user "user0" favorites element "/FOLDER"
  54. And user "user0" unfavorites element "/FOLDER"
  55. Then as "user0" gets properties of folder "/FOLDER" with
  56. |{http://owncloud.org/ns}favorite|
  57. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "0"
  58. Scenario: Favorite a file new endpoint
  59. Given using new dav path
  60. And As an "admin"
  61. And user "user0" exists
  62. When user "user0" favorites element "/textfile0.txt"
  63. Then as "user0" gets properties of file "/textfile0.txt" with
  64. |{http://owncloud.org/ns}favorite|
  65. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "1"
  66. Scenario: Favorite and unfavorite a file new endpoint
  67. Given using new dav path
  68. And As an "admin"
  69. And user "user0" exists
  70. When user "user0" favorites element "/textfile0.txt"
  71. And user "user0" unfavorites element "/textfile0.txt"
  72. Then as "user0" gets properties of file "/textfile0.txt" with
  73. |{http://owncloud.org/ns}favorite|
  74. And the single response should contain a property "{http://owncloud.org/ns}favorite" with value "0"
  75. Scenario: Get favorited elements of a folder
  76. Given using old dav path
  77. And As an "admin"
  78. And user "user0" exists
  79. When user "user0" favorites element "/FOLDER"
  80. And user "user0" favorites element "/textfile0.txt"
  81. And user "user0" favorites element "/textfile1.txt"
  82. Then user "user0" in folder "/" should have favorited the following elements
  83. | /FOLDER |
  84. | /textfile0.txt |
  85. | /textfile1.txt |
  86. Scenario: Get favorited elements of a folder using new path
  87. Given using new dav path
  88. And As an "admin"
  89. And user "user0" exists
  90. When user "user0" favorites element "/FOLDER"
  91. And user "user0" favorites element "/textfile0.txt"
  92. And user "user0" favorites element "/textfile1.txt"
  93. Then user "user0" in folder "/" should have favorited the following elements
  94. | /FOLDER |
  95. | /textfile0.txt |
  96. | /textfile1.txt |
  97. Scenario: Get favorited elements of a subfolder
  98. Given using old dav path
  99. And As an "admin"
  100. And user "user0" exists
  101. And user "user0" created a folder "/subfolder"
  102. And User "user0" moves file "/textfile0.txt" to "/subfolder/textfile0.txt"
  103. And User "user0" moves file "/textfile1.txt" to "/subfolder/textfile1.txt"
  104. And User "user0" moves file "/textfile2.txt" to "/subfolder/textfile2.txt"
  105. When user "user0" favorites element "/subfolder/textfile0.txt"
  106. And user "user0" favorites element "/subfolder/textfile1.txt"
  107. And user "user0" favorites element "/subfolder/textfile2.txt"
  108. And user "user0" unfavorites element "/subfolder/textfile1.txt"
  109. Then user "user0" in folder "/subfolder" should have favorited the following elements
  110. | /subfolder/textfile0.txt |
  111. | /subfolder/textfile2.txt |
  112. Scenario: Get favorited elements of a subfolder using new path
  113. Given using old dav path
  114. And As an "admin"
  115. And user "user0" exists
  116. And user "user0" created a folder "/subfolder"
  117. And User "user0" moves file "/textfile0.txt" to "/subfolder/textfile0.txt"
  118. And User "user0" moves file "/textfile1.txt" to "/subfolder/textfile1.txt"
  119. And User "user0" moves file "/textfile2.txt" to "/subfolder/textfile2.txt"
  120. When user "user0" favorites element "/subfolder/textfile0.txt"
  121. And user "user0" favorites element "/subfolder/textfile1.txt"
  122. And user "user0" favorites element "/subfolder/textfile2.txt"
  123. And user "user0" unfavorites element "/subfolder/textfile1.txt"
  124. Then user "user0" in folder "/subfolder" should have favorited the following elements
  125. | /subfolder/textfile0.txt |
  126. | /subfolder/textfile2.txt |
  127. Scenario: moving a favorite file out of a share keeps favorite state
  128. Given using old dav path
  129. And As an "admin"
  130. And user "user0" exists
  131. And user "user1" exists
  132. And user "user0" created a folder "/shared"
  133. And User "user0" moved file "/textfile0.txt" to "/shared/shared_file.txt"
  134. And folder "/shared" of user "user0" is shared with user "user1"
  135. And user "user1" accepts last share
  136. And user "user1" favorites element "/shared/shared_file.txt"
  137. When User "user1" moved file "/shared/shared_file.txt" to "/taken_out.txt"
  138. Then user "user1" in folder "/" should have favorited the following elements
  139. | /taken_out.txt |