autocomplete.feature 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. Feature: autocomplete
  2. Background:
  3. Given using api version "2"
  4. And group "commongroup" exists
  5. And user "admin" belongs to group "commongroup"
  6. And user "auto" exists
  7. And user "autocomplete" exists
  8. And user "autocomplete2" exists
  9. And user "autocomplete2" belongs to group "commongroup"
  10. Scenario: getting autocomplete
  11. Given As an "admin"
  12. When get autocomplete for "auto"
  13. | id | source |
  14. | auto | users |
  15. | autocomplete | users |
  16. | autocomplete2 | users |
  17. And user "autocomplete" has status "dnd"
  18. When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
  19. Then get autocomplete for "auto"
  20. | id | source | status |
  21. | auto | users | "" |
  22. | autocomplete | users | {"status":"dnd","message":null,"icon":null,"clearAt":null} |
  23. | autocomplete2 | users | "" |
  24. Scenario: getting autocomplete without enumeration
  25. Given As an "admin"
  26. When parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
  27. Then get autocomplete for "auto"
  28. | id | source |
  29. | auto | users |
  30. Then get autocomplete for "autocomplete"
  31. | id | source |
  32. | autocomplete | users |
  33. When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
  34. Then get autocomplete for "auto"
  35. | id | source |
  36. Then get autocomplete for "autocomplete"
  37. | id | source |
  38. Scenario: getting autocomplete emails from address book with enumeration
  39. Given As an "admin"
  40. And sending "PUT" to "/cloud/users/autocomplete" with
  41. | key | email |
  42. | value | autocomplete@example.com |
  43. And there is a contact in an addressbook
  44. Then get email autocomplete for "example"
  45. | id | source |
  46. | autocomplete | users |
  47. | user@example.com | emails |
  48. Then get email autocomplete for "auto"
  49. | id | source |
  50. | autocomplete | users |
  51. Then get email autocomplete for "example"
  52. | id | source |
  53. | autocomplete | users |
  54. | user@example.com | emails |
  55. Then get email autocomplete for "autocomplete@example.com"
  56. | id | source |
  57. | autocomplete | users |
  58. Scenario: getting autocomplete emails from address book without enumeration
  59. Given As an "admin"
  60. And sending "PUT" to "/cloud/users/autocomplete" with
  61. | key | email |
  62. | value | autocomplete@example.com |
  63. And there is a contact in an addressbook
  64. And parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
  65. When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
  66. Then get email autocomplete for "example"
  67. | id | source |
  68. | user@example.com | emails |
  69. When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "yes"
  70. Then get email autocomplete for "auto"
  71. | id | source |
  72. Then get email autocomplete for "example"
  73. | id | source |
  74. | user@example.com | emails |
  75. Then get email autocomplete for "autocomplete@example.com"
  76. | id | source |
  77. | autocomplete | users |
  78. Scenario: getting autocomplete with limited enumeration by group
  79. Given As an "admin"
  80. When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
  81. Then get autocomplete for "auto"
  82. | id | source |
  83. | auto | users |
  84. | autocomplete2 | users |
  85. Then get autocomplete for "autocomplete"
  86. | id | source |
  87. | autocomplete | users |
  88. | autocomplete2 | users |
  89. Then get autocomplete for "autocomplete2"
  90. | id | source |
  91. | autocomplete2 | users |
  92. When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
  93. Then get autocomplete for "autocomplete"
  94. | id | source |
  95. | autocomplete2 | users |
  96. Then get autocomplete for "autocomplete2"
  97. | id | source |
  98. | autocomplete2 | users |
  99. Scenario: getting autocomplete with limited enumeration by phone
  100. Given As an "admin"
  101. When parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
  102. Then get autocomplete for "auto"
  103. | id | source |
  104. | auto | users |
  105. # autocomplete stores their phone number
  106. Given As an "autocomplete"
  107. And sending "PUT" to "/cloud/users/autocomplete" with
  108. | key | phone |
  109. | value | +49 711 / 25 24 28-90 |
  110. And the HTTP status code should be "200"
  111. And the OCS status code should be "200"
  112. Given As an "admin"
  113. Then get autocomplete for "auto"
  114. | id | source |
  115. | auto | users |
  116. # admin populates they have the phone number
  117. When search users by phone for region "DE" with
  118. | random-string1 | 0711 / 252 428-90 |
  119. Then get autocomplete for "auto"
  120. | id | source |
  121. | auto | users |
  122. | autocomplete | users |
  123. When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
  124. Then get autocomplete for "auto"
  125. | id | source |
  126. | autocomplete | users |
  127. Scenario: getting autocomplete with limited enumeration by group or phone
  128. Given As an "admin"
  129. When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
  130. And parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
  131. # autocomplete stores their phone number
  132. Given As an "autocomplete"
  133. And sending "PUT" to "/cloud/users/autocomplete" with
  134. | key | phone |
  135. | value | +49 711 / 25 24 28-90 |
  136. And the HTTP status code should be "200"
  137. And the OCS status code should be "200"
  138. # admin populates they have the phone number
  139. Given As an "admin"
  140. When search users by phone for region "DE" with
  141. | random-string1 | 0711 / 252 428-90 |
  142. Then get autocomplete for "auto"
  143. | id | source |
  144. | auto | users |
  145. | autocomplete | users |
  146. | autocomplete2 | users |
  147. When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
  148. Then get autocomplete for "auto"
  149. | id | source |
  150. | autocomplete | users |
  151. | autocomplete2 | users |
  152. Scenario: getting autocomplete with limited enumeration but sharing is group restricted
  153. Given As an "admin"
  154. When parameter "shareapi_restrict_user_enumeration_to_group" of app "core" is set to "yes"
  155. And parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
  156. # autocomplete stores their phone number
  157. Given As an "autocomplete"
  158. And sending "PUT" to "/cloud/users/autocomplete" with
  159. | key | phone |
  160. | value | +49 711 / 25 24 28-90 |
  161. And the HTTP status code should be "200"
  162. And the OCS status code should be "200"
  163. # admin populates they have the phone number
  164. Given As an "admin"
  165. When search users by phone for region "DE" with
  166. | random-string1 | 0711 / 252 428-90 |
  167. Then get autocomplete for "auto"
  168. | id | source |
  169. | auto | users |
  170. | autocomplete | users |
  171. | autocomplete2 | users |
  172. When parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  173. Then get autocomplete for "auto"
  174. | id | source |
  175. | autocomplete2 | users |
  176. Scenario: getting autocomplete with limited enumeration by phone but user changes it
  177. Given As an "admin"
  178. When parameter "shareapi_restrict_user_enumeration_to_phone" of app "core" is set to "yes"
  179. Then get autocomplete for "auto"
  180. | id | source |
  181. | auto | users |
  182. # autocomplete stores their phone number
  183. Given As an "autocomplete"
  184. And sending "PUT" to "/cloud/users/autocomplete" with
  185. | key | phone |
  186. | value | +49 711 / 25 24 28-90 |
  187. And the HTTP status code should be "200"
  188. And the OCS status code should be "200"
  189. Given As an "admin"
  190. Then get autocomplete for "auto"
  191. | id | source |
  192. | auto | users |
  193. # admin populates they have the phone number
  194. When search users by phone for region "DE" with
  195. | random-string1 | 0711 / 252 428-90 |
  196. Then get autocomplete for "auto"
  197. | id | source |
  198. | auto | users |
  199. | autocomplete | users |
  200. # autocomplete changes their phone number
  201. Given As an "autocomplete"
  202. And sending "PUT" to "/cloud/users/autocomplete" with
  203. | key | phone |
  204. | value | +49 711 / 25 24 28-91 |
  205. And the HTTP status code should be "200"
  206. And the OCS status code should be "200"
  207. Given As an "admin"
  208. Then get autocomplete for "auto"
  209. | id | source |
  210. | auto | users |
  211. # admin populates they have the new phone number
  212. When search users by phone for region "DE" with
  213. | random-string1 | 0711 / 252 428-91 |
  214. Then get autocomplete for "auto"
  215. | id | source |
  216. | auto | users |
  217. | autocomplete | users |
  218. Scenario: getting autocomplete without enumeration and sharing is group restricted
  219. Given As an "admin"
  220. When parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
  221. And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  222. Then get autocomplete for "auto"
  223. | id | source |
  224. Then get autocomplete for "autocomplete"
  225. | id | source |
  226. Then get autocomplete for "autocomplete2"
  227. | id | source |
  228. | autocomplete2 | users |