comments-search.feature 13 KB

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