autocomplete.feature 9.1 KB

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