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