comments-search.feature 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. Feature: comments-search
  2. Scenario: Search my own comment on a file belonging to myself
  3. Given user "user0" exists
  4. And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
  5. And "user0" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
  6. When Logging in using web as "user0"
  7. And searching for "first" in app "files"
  8. Then the list of search results has "1" results
  9. And search result "0" contains
  10. | type | comment |
  11. | comment | My first comment |
  12. | authorId | user0 |
  13. | authorName | user0 |
  14. | path | myFileToComment.txt |
  15. | fileName | myFileToComment.txt |
  16. | name | My first comment |
  17. Scenario: Search my own comment on a file shared by someone with me
  18. Given user "user0" exists
  19. And user "user1" exists
  20. And User "user1" uploads file "data/textfile.txt" to "/sharedFileToComment.txt"
  21. And As "user1" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  22. | path | sharedFileToComment.txt |
  23. | shareWith | user0 |
  24. | shareType | 0 |
  25. And "user0" posts a comment with content "My first comment" on the file named "/sharedFileToComment.txt" it should return "201"
  26. When Logging in using web as "user0"
  27. And searching for "first" in app "files"
  28. Then the list of search results has "1" results
  29. And search result "0" contains
  30. | type | comment |
  31. | comment | My first comment |
  32. | authorId | user0 |
  33. | authorName | user0 |
  34. | path | sharedFileToComment.txt |
  35. | fileName | sharedFileToComment.txt |
  36. | name | My first comment |
  37. Scenario: Search other user's comment on a file shared by me
  38. Given user "user0" exists
  39. And user "user1" exists
  40. And User "user0" uploads file "data/textfile.txt" to "/mySharedFileToComment.txt"
  41. And As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  42. | path | mySharedFileToComment.txt |
  43. | shareWith | user1 |
  44. | shareType | 0 |
  45. And "user1" posts a comment with content "Other's first comment" on the file named "/mySharedFileToComment.txt" it should return "201"
  46. When Logging in using web as "user0"
  47. And searching for "first" in app "files"
  48. Then the list of search results has "1" results
  49. And search result "0" contains
  50. | type | comment |
  51. | comment | Other's first comment |
  52. | authorId | user1 |
  53. | authorName | user1 |
  54. | path | mySharedFileToComment.txt |
  55. | fileName | mySharedFileToComment.txt |
  56. | name | Other's first comment |
  57. Scenario: Search other user's comment on a file shared by someone with me
  58. Given user "user0" exists
  59. And user "user1" exists
  60. And User "user1" uploads file "data/textfile.txt" to "/sharedFileToComment.txt"
  61. And As "user1" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  62. | path | sharedFileToComment.txt |
  63. | shareWith | user0 |
  64. | shareType | 0 |
  65. And "user1" posts a comment with content "Other's first comment" on the file named "/sharedFileToComment.txt" it should return "201"
  66. When Logging in using web as "user0"
  67. And searching for "first" in app "files"
  68. Then the list of search results has "1" results
  69. And search result "0" contains
  70. | type | comment |
  71. | comment | Other's first comment |
  72. | authorId | user1 |
  73. | authorName | user1 |
  74. | path | sharedFileToComment.txt |
  75. | fileName | sharedFileToComment.txt |
  76. | name | Other's first comment |
  77. Scenario: Search several comments on a file belonging to myself
  78. Given user "user0" exists
  79. And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
  80. And "user0" posts a comment with content "My first comment to be found" on the file named "/myFileToComment.txt" it should return "201"
  81. And "user0" posts a comment with content "The second comment should not be found" on the file named "/myFileToComment.txt" it should return "201"
  82. And "user0" posts a comment with content "My third comment to be found" on the file named "/myFileToComment.txt" it should return "201"
  83. When Logging in using web as "user0"
  84. And searching for "comment to be found" in app "files"
  85. Then the list of search results has "2" results
  86. And search result "0" contains
  87. | type | comment |
  88. | comment | My third comment to be found |
  89. | authorId | user0 |
  90. | authorName | user0 |
  91. | path | myFileToComment.txt |
  92. | fileName | myFileToComment.txt |
  93. | name | My third comment to be found |
  94. And search result "1" contains
  95. | type | comment |
  96. | comment | My first comment to be found |
  97. | authorId | user0 |
  98. | authorName | user0 |
  99. | path | myFileToComment.txt |
  100. | fileName | myFileToComment.txt |
  101. | name | My first comment to be found |
  102. Scenario: Search comment with a large message ellipsized on the right
  103. Given user "user0" exists
  104. And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
  105. And "user0" posts a comment with content "A very verbose message that is meant to be used to test the ellipsized message returned when searching for long comments" on the file named "/myFileToComment.txt" it should return "201"
  106. When Logging in using web as "user0"
  107. And searching for "verbose" in app "files"
  108. Then the list of search results has "1" results
  109. And search result "0" contains
  110. | type | comment |
  111. | comment | A very verbose message that is meant to… |
  112. | authorId | user0 |
  113. | authorName | user0 |
  114. | path | myFileToComment.txt |
  115. | fileName | myFileToComment.txt |
  116. | name | A very verbose message that is meant to be used to test the ellipsized message returned when searching for long comments |
  117. Scenario: Search comment with a large message ellipsized on the left
  118. Given user "user0" exists
  119. And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
  120. And "user0" posts a comment with content "A very verbose message that is meant to be used to test the ellipsized message returned when searching for long comments" on the file named "/myFileToComment.txt" it should return "201"
  121. When Logging in using web as "user0"
  122. And searching for "searching" in app "files"
  123. Then the list of search results has "1" results
  124. And search result "0" contains
  125. | type | comment |
  126. | comment | …ed message returned when searching for long comments |
  127. | authorId | user0 |
  128. | authorName | user0 |
  129. | path | myFileToComment.txt |
  130. | fileName | myFileToComment.txt |
  131. | name | A very verbose message that is meant to be used to test the ellipsized message returned when searching for long comments |
  132. Scenario: Search comment with a large message ellipsized on both ends
  133. Given user "user0" exists
  134. And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
  135. And "user0" posts a comment with content "A very verbose message that is meant to be used to test the ellipsized message returned when searching for long comments" on the file named "/myFileToComment.txt" it should return "201"
  136. When Logging in using web as "user0"
  137. And searching for "ellipsized" in app "files"
  138. Then the list of search results has "1" results
  139. And search result "0" contains
  140. | type | comment |
  141. | comment | …t to be used to test the ellipsized message returned when se… |
  142. | authorId | user0 |
  143. | authorName | user0 |
  144. | path | myFileToComment.txt |
  145. | fileName | myFileToComment.txt |
  146. | name | A very verbose message that is meant to be used to test the ellipsized message returned when searching for long comments |
  147. Scenario: Search comment on a file in a subfolder
  148. Given user "user0" exists
  149. And user "user0" created a folder "/subfolder"
  150. And User "user0" uploads file "data/textfile.txt" to "/subfolder/myFileToComment.txt"
  151. And "user0" posts a comment with content "My first comment" on the file named "/subfolder/myFileToComment.txt" it should return "201"
  152. When Logging in using web as "user0"
  153. And searching for "first" in app "files"
  154. Then the list of search results has "1" results
  155. And search result "0" contains
  156. | type | comment |
  157. | comment | My first comment |
  158. | authorId | user0 |
  159. | authorName | user0 |
  160. | path | subfolder/myFileToComment.txt |
  161. | fileName | myFileToComment.txt |
  162. | name | My first comment |
  163. Scenario: Search several comments
  164. Given user "user0" exists
  165. And user "user1" exists
  166. And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
  167. And User "user0" uploads file "data/textfile.txt" to "/mySharedFileToComment.txt"
  168. And As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  169. | path | mySharedFileToComment.txt |
  170. | shareWith | user1 |
  171. | shareType | 0 |
  172. And User "user1" uploads file "data/textfile.txt" to "/sharedFileToComment.txt"
  173. And As "user1" sending "POST" to "/apps/files_sharing/api/v1/shares" with
  174. | path | sharedFileToComment.txt |
  175. | shareWith | user0 |
  176. | shareType | 0 |
  177. And "user0" posts a comment with content "My first comment to be found" on the file named "/myFileToComment.txt" it should return "201"
  178. And "user0" posts a comment with content "The second comment should not be found" on the file named "/myFileToComment.txt" it should return "201"
  179. And "user0" posts a comment with content "My first comment to be found" on the file named "/mySharedFileToComment.txt" it should return "201"
  180. And "user1" posts a comment with content "Other's first comment that should not be found" on the file named "/mySharedFileToComment.txt" it should return "201"
  181. And "user1" posts a comment with content "Other's second comment to be found" on the file named "/mySharedFileToComment.txt" it should return "201"
  182. And "user0" posts a comment with content "My first comment that should not be found" on the file named "/sharedFileToComment.txt" it should return "201"
  183. And "user1" posts a comment with content "Other's first comment to be found" on the file named "/sharedFileToComment.txt" it should return "201"
  184. And "user0" posts a comment with content "My second comment to be found that happens to be more verbose than the others and thus should be ellipsized" on the file named "/sharedFileToComment.txt" it should return "201"
  185. And "user0" posts a comment with content "My third comment to be found" on the file named "/myFileToComment.txt" it should return "201"
  186. When Logging in using web as "user0"
  187. And searching for "comment to be found" in app "files"
  188. Then the list of search results has "6" results
  189. And search result "0" contains
  190. | type | comment |
  191. | comment | My third comment to be found |
  192. | authorId | user0 |
  193. | authorName | user0 |
  194. | path | myFileToComment.txt |
  195. | fileName | myFileToComment.txt |
  196. | name | My third comment to be found |
  197. And search result "1" contains
  198. | type | comment |
  199. | comment | My second comment to be found that happens to be more … |
  200. | authorId | user0 |
  201. | authorName | user0 |
  202. | path | sharedFileToComment.txt |
  203. | fileName | sharedFileToComment.txt |
  204. | name | My second comment to be found that happens to be more verbose than the others and thus should be ellipsized |
  205. And search result "2" contains
  206. | type | comment |
  207. | comment | Other's first comment to be found |
  208. | authorId | user1 |
  209. | authorName | user1 |
  210. | path | sharedFileToComment.txt |
  211. | fileName | sharedFileToComment.txt |
  212. | name | Other's first comment to be found |
  213. And search result "3" contains
  214. | type | comment |
  215. | comment | Other's second comment to be found |
  216. | authorId | user1 |
  217. | authorName | user1 |
  218. | path | mySharedFileToComment.txt |
  219. | fileName | mySharedFileToComment.txt |
  220. | name | Other's second comment to be found |
  221. And search result "4" contains
  222. | type | comment |
  223. | comment | My first comment to be found |
  224. | authorId | user0 |
  225. | authorName | user0 |
  226. | path | mySharedFileToComment.txt |
  227. | fileName | mySharedFileToComment.txt |
  228. | name | My first comment to be found |
  229. And search result "5" contains
  230. | type | comment |
  231. | comment | My first comment to be found |
  232. | authorId | user0 |
  233. | authorName | user0 |
  234. | path | myFileToComment.txt |
  235. | fileName | myFileToComment.txt |
  236. | name | My first comment to be found |
  237. Scenario: Search comment with a query that also matches a file name
  238. Given user "user0" exists
  239. And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
  240. And "user0" posts a comment with content "A comment in myFileToComment.txt" on the file named "/myFileToComment.txt" it should return "201"
  241. When Logging in using web as "user0"
  242. And searching for "myFileToComment" in app "files"
  243. Then the list of search results has "2" results
  244. And search result "0" contains
  245. | type | file |
  246. | path | /myFileToComment.txt |
  247. | name | myFileToComment.txt |
  248. And search result "1" contains
  249. | type | comment |
  250. | comment | A comment in myFileToComment.txt |
  251. | authorId | user0 |
  252. | authorName | user0 |
  253. | path | myFileToComment.txt |
  254. | fileName | myFileToComment.txt |
  255. | name | A comment in myFileToComment.txt |