Proyectos de Subversion Moodle

Rev

Rev 11 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@tool @tool_dataprivacy
2
Feature: Data export from the privacy API
3
  In order to export data for users and meet legal requirements
4
  As an admin, user, or parent
5
  I need to be able to export data for a user
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username  | firstname      | lastname  | institution |
10
      | victim    | Victim User    | 1         | University1 |
11
      | victim2   | Victim User    | 2         | University2 |
12
      | requester | The            | Requester | University3 |
13
      | parent    | Long-suffering | Parent    |             |
14
    And the following "roles" exist:
15
      | shortname | name  | archetype |
16
      | tired     | Tired |           |
17
    And the following "permission overrides" exist:
18
      | capability                                   | permission | role    | contextlevel | reference |
19
      | tool/dataprivacy:makedatarequestsforchildren | Allow      | tired   | System       |           |
20
      | tool/dataprivacy:managedatarequests          | Allow      | manager | System       |           |
21
      | moodle/site:viewuseridentity                 | Prevent    | manager | System       |           |
22
    And the following "role assigns" exist:
23
      | user   | role  | contextlevel | reference |
24
      | parent | tired | User         | victim    |
25
    And the following "system role assigns" exist:
26
      | user      | role    | contextlevel |
27
      | requester | manager | User         |
28
    And the following config values are set as admin:
29
      | contactdataprotectionofficer | 1  | tool_dataprivacy |
30
      | privacyrequestexpiry         | 55 | tool_dataprivacy |
31
      | dporoles                     | 1  | tool_dataprivacy |
32
    And the following data privacy "categories" exist:
33
      | name          |
34
      | Site category |
35
    And the following data privacy "purposes" exist:
36
      | name         | retentionperiod |
37
      | Site purpose | P10Y           |
38
    And I set the site category and purpose to "Site category" and "Site purpose"
39
 
40
  @javascript
41
  Scenario: As admin, export data for a user and download it, unless it has expired
42
    Given I log in as "admin"
43
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
44
    And I follow "New request"
45
    And I set the field "User" to "Victim User 1"
46
    And I press "Save changes"
47
    Then I should see "Victim User 1"
48
    And I should see "Awaiting approval" in the "Victim User 1" "table_row"
49
    And I open the action menu in "Victim User 1" "table_row"
50
    And I follow "Approve request"
1441 ariadna 51
    And I wait until "Approve request" "button" exists
1 efrain 52
    And I press "Approve request"
53
    And I should see "Approved" in the "Victim User 1" "table_row"
54
    And I run all adhoc tasks
55
    And I reload the page
56
    And I should see "Download ready" in the "Victim User 1" "table_row"
57
    And I open the action menu in "Victim User 1" "table_row"
1441 ariadna 58
    And following "Download" should download a file that:
59
      | Contains file in zip | index.html |
1 efrain 60
    And the following config values are set as admin:
61
      | privacyrequestexpiry | 1 | tool_dataprivacy |
62
    And I wait "1" seconds
63
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
64
    And I should see "Expired" in the "Victim User 1" "table_row"
65
    And I open the action menu in "Victim User 1" "table_row"
66
    And I should not see "Download"
67
 
68
  @javascript
69
  Scenario: As a student, request data export and then download it when approved, unless it has expired
70
    Given I log in as "victim"
71
    And I follow "Profile" in the user menu
72
    And I follow "Data requests"
73
    And I follow "New request"
74
    And I press "Save changes"
75
    Then I should see "Export all of my personal data"
76
    And I should see "Awaiting approval" in the "Export all of my personal data" "table_row"
77
 
78
    And I log out
79
    And I log in as "admin"
80
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
81
    And I open the action menu in "Victim User 1" "table_row"
82
    And I follow "Approve request"
83
    And I press "Approve request"
84
 
85
    And I log out
86
    And I log in as "victim"
87
    And I follow "Profile" in the user menu
88
    And I follow "Data requests"
89
    And I should see "Approved" in the "Export all of my personal data" "table_row"
90
    And I run all adhoc tasks
91
    And I reload the page
92
    And I should see "Download ready" in the "Export all of my personal data" "table_row"
93
    And I open the action menu in "Victim User 1" "table_row"
1441 ariadna 94
    And following "Download" should download a file that:
95
      | Contains file in zip | index.html |
1 efrain 96
 
97
    And the following config values are set as admin:
98
      | privacyrequestexpiry | 1 | tool_dataprivacy |
99
    And I wait "1" seconds
100
    And I reload the page
101
 
102
    And I should see "Expired" in the "Export all of my personal data" "table_row"
103
    And I should not see "Actions"
104
 
105
  @javascript
106
  Scenario: As a parent, request data export for my child because I don't trust the little blighter
107
    Given I log in as "parent"
108
    And I follow "Profile" in the user menu
109
    And I follow "Data requests"
110
    And I follow "New request"
111
    And I set the field "User" to "Victim User 1"
112
    And I press "Save changes"
113
    Then I should see "Victim User 1"
114
    And I should see "Awaiting approval" in the "Victim User 1" "table_row"
115
 
116
    And I log out
117
    And I log in as "admin"
118
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
119
    And I open the action menu in "Victim User 1" "table_row"
120
    And I follow "Approve request"
1441 ariadna 121
    And I wait until "Approve request" "button" exists
1 efrain 122
    And I press "Approve request"
123
 
124
    And I log out
125
    And I log in as "parent"
126
    And I follow "Profile" in the user menu
127
    And I follow "Data requests"
128
    And I should see "Approved" in the "Victim User 1" "table_row"
129
    And I run all adhoc tasks
130
    And I reload the page
131
    And I should see "Download ready" in the "Victim User 1" "table_row"
132
    And I open the action menu in "Victim User 1" "table_row"
1441 ariadna 133
    And following "Download" should download a file that:
134
      | Contains file in zip | index.html |
1 efrain 135
 
136
    And the following config values are set as admin:
137
      | privacyrequestexpiry | 1 | tool_dataprivacy |
138
    And I wait "1" seconds
139
    And I reload the page
140
 
141
    And I should see "Expired" in the "Victim User 1" "table_row"
142
    And I should not see "Actions"
143
 
144
  @javascript
145
  Scenario: Test search for user using extra field.
146
    Given the following "permission overrides" exist:
147
      | capability                   | permission | role    | contextlevel | reference |
148
      | moodle/site:viewuseridentity | Allow      | manager | System       |           |
149
    And the following config values are set as admin:
150
      | showuseridentity | institution |
151
    And I log in as "requester"
152
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
153
    And I follow "New request"
154
    And I set the field "Search" to "University1"
155
    Then I should see "Victim User 1"
156
    When I reload the page
157
    And I set the field "Search" to "University2"
158
    Then I should see "Victim User 2"
159
 
160
  Scenario: Request data export as student with automatic approval turned on
161
    Given the following config values are set as admin:
162
      | automaticdataexportapproval | 1  | tool_dataprivacy |
163
    And I log in as "victim"
164
    And I follow "Profile" in the user menu
165
    And I follow "Export all of my personal data"
166
    When I press "Save changes"
167
    Then I should see "Your request has been submitted and will be processed soon."
168
    And I should see "Approved" in the "Export all of my personal data" "table_row"
169
 
170
  @javascript
171
  Scenario: As admin, enable allow filtering of exports by course setting, export data for a user and download it
172
    Given the following config values are set as admin:
173
      | allowfiltering | 1 | tool_dataprivacy |
174
    And I log in as "admin"
175
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
176
    And I follow "New request"
177
    And I set the field "User" to "Victim User 1"
178
    And I should see "Export my personal data"
179
    And I press "Save changes"
180
    Then I should see "Victim User 1"
181
    And I should see "Pending" in the "Victim User 1" "table_row"
182
    And I run all adhoc tasks
183
    And I reload the page
184
    And I should see "Awaiting approval" in the "Victim User 1" "table_row"
185
    And I open the action menu in "Victim User 1" "table_row"
186
    And I follow "Approve request (all data)"
187
    And I press "Approve request"
188
    And I should see "Approved" in the "Victim User 1" "table_row"
189
    And I run all adhoc tasks
190
    And I reload the page
191
    And I should see "Download ready" in the "Victim User 1" "table_row"
192
    And I open the action menu in "Victim User 1" "table_row"
1441 ariadna 193
    And following "Download" should download a file that:
194
      | Contains file in zip | index.html |
1 efrain 195
    And the following config values are set as admin:
196
      | privacyrequestexpiry | 1 | tool_dataprivacy |
197
    And I wait "1" seconds
198
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
199
    And I should see "Expired" in the "Victim User 1" "table_row"
200
    And I open the action menu in "Victim User 1" "table_row"
201
    And I should not see "Download"
202
 
203
  @javascript
204
  Scenario: As admin, enable allow filtering of exports by course setting, filter before export data for a user and download it
205
    Given the following "courses" exist:
206
      | fullname | shortname |
207
      | Course 1 | C1        |
208
      | Course 2 | C2        |
209
      | Coruse 3 | C3        |
210
    And the following "course enrolments" exist:
211
      | user    | course | role    |
212
      | victim  | C1     | student |
213
      | victim  | C2     | student |
214
    And the following config values are set as admin:
215
      | allowfiltering | 1 | tool_dataprivacy |
216
    And I log in as "admin"
217
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
218
    And I follow "New request"
219
    And I set the field "User" to "Victim User 1"
220
    And I press "Save changes"
221
    Then I should see "Victim User 1"
222
    And I run all adhoc tasks
223
    And I reload the page
224
    And I open the action menu in "Victim User 1" "table_row"
225
    And I follow "Approve request (data from selected courses)"
226
    And I should see "Course 1"
227
    And I should see "Course 2"
228
    And I should not see "Course 3"
229
    And I press "Approve request"
230
    And I should see "You must select at least one course"
231
    And I set the field "Select courses to export" to "Course 1"
232
    And I press "Approve request"
233
    And I should see "Approved" in the "Victim User 1" "table_row"
234
    And I run all adhoc tasks
235
    And I reload the page
236
    And I should see "Download ready" in the "Victim User 1" "table_row"
237
    And I open the action menu in "Victim User 1" "table_row"
1441 ariadna 238
    And following "Download" should download a file that:
239
      | Contains file in zip | index.html |
1 efrain 240
 
241
  @javascript
242
  Scenario: Filter before export data for a user and download it in the view request action
243
    Given the following "courses" exist:
244
      | fullname | shortname |
245
      | Course 1 | C1        |
246
      | Course 2 | C2        |
247
      | Coruse 3 | C3        |
248
    And the following "course enrolments" exist:
249
      | user    | course | role    |
250
      | victim  | C1     | student |
251
      | victim  | C2     | student |
252
    And the following config values are set as admin:
253
      | allowfiltering | 1 | tool_dataprivacy |
254
    And I log in as "admin"
255
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
256
    And I follow "New request"
257
    And I set the field "User" to "Victim User 1"
258
    And I press "Save changes"
259
    Then I should see "Victim User 1"
260
    And I run all adhoc tasks
261
    And I reload the page
262
    And I open the action menu in "Victim User 1" "table_row"
263
    And I follow "View the request"
264
    And I press "Approve selected courses"
265
    And I set the field "Select courses to export" to "Course 1"
266
    And I press "Approve request"
267
    And I should see "Approved" in the "Victim User 1" "table_row"
268
    And I run all adhoc tasks
269
    And I reload the page
270
    And I should see "Download ready" in the "Victim User 1" "table_row"
271
    And I open the action menu in "Victim User 1" "table_row"
1441 ariadna 272
    And following "Download" should download a file that:
273
      | Contains file in zip | index.html |