-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathusers.feature
More file actions
210 lines (185 loc) · 9.77 KB
/
users.feature
File metadata and controls
210 lines (185 loc) · 9.77 KB
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
@endpoint(users) @endpoint(users-v2)
Feature: Users
Create, edit, and disable users.
Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "Users" API
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Anonymize users returns "Bad Request" response
Given operation "AnonymizeUsers" enabled
And new "AnonymizeUsers" request
And body with value {"data": {"attributes": {"user_ids": ["00000000-0000-0000-0000-000000000000"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "anonymize_users_request"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Anonymize users returns "OK" response
Given operation "AnonymizeUsers" enabled
And new "AnonymizeUsers" request
And body with value {"data": {"attributes": {"user_ids": ["00000000-0000-0000-0000-000000000000"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "anonymize_users_request"}}
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Create a user returns "Bad Request" response
Given new "CreateUser" request
And body with value {"data": {"attributes": {"email": "jane.doe@example.com"}, "relationships": {"roles": {"data": [{"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}]}}, "type": "users"}}
When the request is sent
Then the response status is 400 Bad Request
@team:DataDog/team-aaa-identity
Scenario: Create a user returns "OK" response
Given new "CreateUser" request
And body with value {"data": {"type": "users", "attributes": {"name": "Datadog API Client Python", "email": "{{ unique }}@datadoghq.com"}}}
When the request is sent
Then the response status is 201 OK
And the response "data.attributes.email" is equal to "{{ unique_lower }}@datadoghq.com"
And the response "data.attributes.name" is equal to "Datadog API Client Python"
And the response "data.attributes.disabled" is false
And the response "data.attributes.service_account" is false
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Disable a user returns "Not found" response
Given new "DisableUser" request
And request contains "user_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not found
@team:DataDog/team-aaa-identity
Scenario: Disable a user returns "OK" response
Given there is a valid "user" in the system
And new "DisableUser" request
And request contains "user_id" parameter from "user.data.id"
When the request is sent
Then the response status is 204 OK
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Get a user invitation returns "Not found" response
Given new "GetInvitation" request
And request contains "user_invitation_uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not found
@team:DataDog/team-aaa-identity
Scenario: Get a user invitation returns "OK" response
Given there is a valid "user" in the system
And the "user" has a "user_invitation"
And new "GetInvitation" request
And request contains "user_invitation_uuid" parameter from "user_invitation.id"
When the request is sent
Then the response status is 200 OK
And the response "data.attributes.invite_type" is equal to "openid_invite"
And the response "data.attributes.uuid" is equal to "{{user_invitation.id}}"
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Get a user organization returns "Not found" response
Given new "ListUserOrganizations" request
And request contains "user_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not found
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Get a user organization returns "OK" response
Given new "ListUserOrganizations" request
And request contains "user_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Get a user permissions returns "Not found" response
Given new "ListUserPermissions" request
And request contains "user_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not found
@team:DataDog/team-aaa-identity
Scenario: Get a user permissions returns "OK" response
Given there is a valid "user" in the system
And new "ListUserPermissions" request
And request contains "user_id" parameter from "user.data.id"
When the request is sent
Then the response status is 200 OK
And the response "data" has length 0
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Get user details returns "Not found" response
Given new "GetUser" request
And request contains "user_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not found
@team:DataDog/team-aaa-identity
Scenario: Get user details returns "OK" response
Given there is a valid "user" in the system
And new "GetUser" request
And request contains "user_id" parameter from "user.data.id"
When the request is sent
Then the response status is 200 OK for get user
And the response "data.id" is equal to "{{ user.data.id }}"
And the response "data.type" is equal to "users"
And the response "data.attributes.handle" is equal to "{{ unique_lower }}@datadoghq.com"
@generated @skip @team:DataDog/team-aaa-identity
Scenario: List all users returns "Bad Request" response
Given new "ListUsers" request
When the request is sent
Then the response status is 400 Bad Request
@team:DataDog/team-aaa-identity
Scenario: List all users returns "OK" response
Given there is a valid "user" in the system
And new "ListUsers" request
And request contains "filter" parameter from "user.data.attributes.email"
When the request is sent
Then the response status is 200 OK
And the response "meta.page.total_filtered_count" is equal to 1
And the response "data[0].attributes.email" has the same value as "user.data.attributes.email"
@replay-only @skip-validation @team:DataDog/team-aaa-identity @with-pagination
Scenario: List all users returns "OK" response with pagination
Given new "ListUsers" request
And request contains "page[size]" parameter with value 2
When the request with pagination is sent
Then the response status is 200 OK
And the response has 3 items
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Send invitation emails returns "Bad Request" response
Given new "SendInvitations" request
And body with value {"data": []}
When the request is sent
Then the response status is 400 Bad Request
@team:DataDog/team-aaa-identity
Scenario: Send invitation emails returns "OK" response
Given there is a valid "user" in the system
And new "SendInvitations" request
And body with value {"data": [{"type": "user_invitations", "relationships": {"user": {"data": {"type": "{{ user.data.type }}", "id": "{{ user.data.id }}"}}}}]}
When the request is sent
Then the response status is 201 OK
And the response "data" has length 1
And the response "data[0].attributes.invite_type" is equal to "openid_invite"
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Update a user returns "Bad Request" response
Given new "UpdateUser" request
And request contains "user_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}}
When the request is sent
Then the response status is 400 Bad Request
@team:DataDog/team-aaa-identity
Scenario: Update a user returns "Bad User ID in Request" response
Given there is a valid "user" in the system
And new "UpdateUser" request
And request contains "user_id" parameter from "user.data.id"
And body with value {"data": {"id": "00000000-mismatch-body-id-ffffffffffff", "type": "users", "attributes": {"name": "updated", "disabled": true}}}
When the request is sent
Then the response status is 422 Bad User ID in Request
@team:DataDog/team-aaa-identity
Scenario: Update a user returns "Not found" response
Given new "UpdateUser" request
And request contains "user_id" parameter with value "00000000-dead-beef-dead-ffffffffffff"
And body with value {"data": {"id": "00000000-dead-beef-dead-ffffffffffff", "type": "users", "attributes": {"name": "updated", "disabled": true}}}
When the request is sent
Then the response status is 404 Not found
@team:DataDog/team-aaa-identity
Scenario: Update a user returns "OK" response
Given there is a valid "user" in the system
And new "UpdateUser" request
And request contains "user_id" parameter from "user.data.id"
And body with value {"data": {"id": "{{ user.data.id }}", "type": "users", "attributes": {"name": "updated", "disabled": true}}}
When the request is sent
Then the response status is 200 OK
And the response "data.attributes.email" has the same value as "user.data.attributes.email"
And the response "data.attributes.title" has the same value as "user.data.attributes.title"
And the response "data.attributes.name" is equal to "updated"
And the response "data.attributes.disabled" is equal to true
@generated @skip @team:DataDog/team-aaa-identity
Scenario: Update a user returns "Unprocessable Entity" response
Given new "UpdateUser" request
And request contains "user_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}}
When the request is sent
Then the response status is 422 Unprocessable Entity