contacts-menu.feature 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. # SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. Feature: contacts-menu
  4. Scenario: users can be searched by display name
  5. Given user "user0" exists
  6. And user "user1" exists
  7. And As an "admin"
  8. And sending "PUT" to "/cloud/users/user1" with
  9. | key | displayname |
  10. | value | Test name |
  11. When Logging in using web as "user0"
  12. And searching for contacts matching with "test"
  13. Then the list of searched contacts has "1" contacts
  14. And searched contact "0" is named "Test name"
  15. Scenario: users can be searched by email
  16. Given user "user0" exists
  17. And user "user1" exists
  18. And As an "admin"
  19. And sending "PUT" to "/cloud/users/user1" with
  20. | key | email |
  21. | value | test@example.com |
  22. When Logging in using web as "user0"
  23. And searching for contacts matching with "test"
  24. Then the list of searched contacts has "1" contacts
  25. And searched contact "0" is named "user1"
  26. Scenario: users can not be searched by id
  27. Given user "user0" exists
  28. And user "user1" exists
  29. And As an "admin"
  30. And sending "PUT" to "/cloud/users/user1" with
  31. | key | displayname |
  32. | value | Test name |
  33. When Logging in using web as "user0"
  34. And searching for contacts matching with "user"
  35. Then the list of searched contacts has "0" contacts
  36. Scenario: search several users
  37. Given user "user0" exists
  38. And user "user1" exists
  39. And user "user2" exists
  40. And user "user3" exists
  41. And user "user4" exists
  42. And user "user5" exists
  43. And As an "admin"
  44. And sending "PUT" to "/cloud/users/user1" with
  45. | key | displayname |
  46. | value | Test name |
  47. And sending "PUT" to "/cloud/users/user2" with
  48. | key | email |
  49. | value | test@example.com |
  50. And sending "PUT" to "/cloud/users/user3" with
  51. | key | displayname |
  52. | value | Unmatched name |
  53. And sending "PUT" to "/cloud/users/user4" with
  54. | key | email |
  55. | value | unmatched@example.com |
  56. And sending "PUT" to "/cloud/users/user5" with
  57. | key | displayname |
  58. | value | Another test name |
  59. And sending "PUT" to "/cloud/users/user5" with
  60. | key | email |
  61. | value | another_test@example.com |
  62. When Logging in using web as "user0"
  63. And searching for contacts matching with "test"
  64. Then the list of searched contacts has "3" contacts
  65. # Results are sorted alphabetically
  66. And searched contact "0" is named "Another test name"
  67. And searched contact "1" is named "Test name"
  68. And searched contact "2" is named "user2"
  69. Scenario: users can not be found by display name if visibility is private
  70. Given user "user0" exists
  71. And user "user1" exists
  72. And user "user2" exists
  73. And Logging in using web as "user1"
  74. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  75. | displayname | Test name |
  76. | displaynameScope | private |
  77. And Logging in using web as "user2"
  78. And Sending a "PUT" to "/settings/users/user2/settings" with requesttoken
  79. | displayname | Another test name |
  80. | displaynameScope | contacts |
  81. When Logging in using web as "user0"
  82. And searching for contacts matching with "test"
  83. # Disabled because it regularly fails on drone:
  84. # Then the list of searched contacts has "1" contacts
  85. # And searched contact "0" is named "Another test name"
  86. Scenario: users can not be found by email if visibility is private
  87. Given user "user0" exists
  88. And user "user1" exists
  89. And user "user2" exists
  90. And Logging in using web as "user1"
  91. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  92. | email | test@example.com |
  93. | emailScope | private |
  94. And Logging in using web as "user2"
  95. And Sending a "PUT" to "/settings/users/user2/settings" with requesttoken
  96. | email | another_test@example.com |
  97. | emailScope | contacts |
  98. # Disabled because it regularly fails on drone:
  99. # When Logging in using web as "user0"
  100. # And searching for contacts matching with "test"
  101. # Then the list of searched contacts has "1" contacts
  102. # And searched contact "0" is named "user2"
  103. Scenario: users can be found by other properties if the visibility of one is private
  104. Given user "user0" exists
  105. And user "user1" exists
  106. And user "user2" exists
  107. And Logging in using web as "user1"
  108. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  109. | displayname | Test name |
  110. | displaynameScope | contacts |
  111. | email | test@example.com |
  112. | emailScope | private |
  113. And Logging in using web as "user2"
  114. And Sending a "PUT" to "/settings/users/user2/settings" with requesttoken
  115. | displayname | Another test name |
  116. | displaynameScope | private |
  117. | email | another_test@example.com |
  118. | emailScope | contacts |
  119. When Logging in using web as "user0"
  120. And searching for contacts matching with "test"
  121. Then the list of searched contacts has "2" contacts
  122. # Disabled because it regularly fails on drone:
  123. # And searched contact "0" is named ""
  124. And searched contact "1" is named "Test name"
  125. Scenario: users can be searched by display name if visibility is increased again
  126. Given user "user0" exists
  127. And user "user1" exists
  128. And Logging in using web as "user1"
  129. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  130. | displayname | Test name |
  131. | displaynameScope | private |
  132. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  133. | displaynameScope | contacts |
  134. When Logging in using web as "user0"
  135. And searching for contacts matching with "test"
  136. Then the list of searched contacts has "1" contacts
  137. And searched contact "0" is named "Test name"
  138. Scenario: users can be searched by email if visibility is increased again
  139. Given user "user0" exists
  140. And user "user1" exists
  141. And Logging in using web as "user1"
  142. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  143. | email | test@example.com |
  144. | emailScope | private |
  145. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  146. | emailScope | contacts |
  147. # Disabled because it regularly fails on drone:
  148. # When Logging in using web as "user0"
  149. # And searching for contacts matching with "test"
  150. # Then the list of searched contacts has "1" contacts
  151. # And searched contact "0" is named "user1"
  152. Scenario: users can not be searched by display name if visibility is private even if updated with provisioning
  153. Given user "user0" exists
  154. And user "user1" exists
  155. And Logging in using web as "user1"
  156. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  157. | displaynameScope | private |
  158. And As an "admin"
  159. And sending "PUT" to "/cloud/users/user1" with
  160. | key | displayname |
  161. | value | Test name |
  162. When Logging in using web as "user0"
  163. And searching for contacts matching with "test"
  164. # Disabled because it regularly fails on drone:
  165. # Then the list of searched contacts has "0" contacts
  166. Scenario: users can not be searched by email if visibility is private even if updated with provisioning
  167. Given user "user0" exists
  168. And user "user1" exists
  169. And Logging in using web as "user1"
  170. And Sending a "PUT" to "/settings/users/user1/settings" with requesttoken
  171. | emailScope | private |
  172. And As an "admin"
  173. And sending "PUT" to "/cloud/users/user1" with
  174. | key | email |
  175. | value | test@example.com |
  176. When Logging in using web as "user0"
  177. And searching for contacts matching with "test"
  178. # Disabled because it regularly fails on drone:
  179. # Then the list of searched contacts has "0" contacts