|
| 1 | +@core_dataprivacy @app @javascript @lms_from4.4 |
| 2 | +Feature: Data export and delete from the privacy API |
| 3 | + In order to export or delete data for users and meet legal requirements |
| 4 | + I need to be able to request my data data be exported or deleted |
| 5 | + |
| 6 | + Background: |
| 7 | + Given the following "users" exist: |
| 8 | + | username | firstname | lastname | |
| 9 | + | victim | Victim User | 1 | |
| 10 | + And the following config values are set as admin: |
| 11 | + | contactdataprotectionofficer | 1 | tool_dataprivacy | |
| 12 | + | privacyrequestexpiry | 55 | tool_dataprivacy | |
| 13 | + | dporoles | 1 | tool_dataprivacy | |
| 14 | + |
| 15 | + Scenario: As a student, request deletion of account and data |
| 16 | + Given I entered the app as "victim" |
| 17 | + And I press the user menu button in the app |
| 18 | + And I press "Data privacy" in the app |
| 19 | + And I press "New request" in the app |
| 20 | + And I press "Delete all of my personal data" in the app |
| 21 | + And I press "Send" in the app |
| 22 | + Then I should find "Delete all of my personal data" in the app |
| 23 | + And I should find "Awaiting approval" near "Delete all of my personal data" in the app |
| 24 | + |
| 25 | + Scenario: As a student, I cannot create data deletion request unless I have permission. |
| 26 | + Given the following "permission overrides" exist: |
| 27 | + | capability | permission | role | contextlevel | reference | |
| 28 | + | tool/dataprivacy:requestdelete | Prevent | user | System | | |
| 29 | + And I entered the app as "victim" |
| 30 | + And I press the user menu button in the app |
| 31 | + And I press "Data privacy" in the app |
| 32 | + When I press "New request" in the app |
| 33 | + Then I should not find "Delete all of my personal data" in the app |
| 34 | + |
| 35 | + Scenario: As a student, request data export and then see the status |
| 36 | + Given I entered the app as "victim" |
| 37 | + And I press the user menu button in the app |
| 38 | + And I press "Data privacy" in the app |
| 39 | + When I press "New request" in the app |
| 40 | + And I press "Export all of my personal data" in the app |
| 41 | + And I set the field "Comments" to "Export my data" in the app |
| 42 | + And I press "Send" in the app |
| 43 | + Then I should find "Export all of my personal data" in the app |
| 44 | + And I should find "Awaiting approval" near "Export all of my personal data" in the app |
| 45 | + And I should find "Export my data" near "Export all of my personal data" in the app |
| 46 | + |
| 47 | + # The next step allows to naavigate to site administration |
| 48 | + When I change viewport size to "1200x640" in the app |
| 49 | + And I open a browser tab with url "$WWWROOT" |
| 50 | + And I log in as "admin" |
| 51 | + And I navigate to "Users > Privacy and policies > Data requests" in site administration |
| 52 | + And I open the action menu in "Victim User 1" "table_row" |
| 53 | + And I follow "Approve request" |
| 54 | + And I press "Approve request" |
| 55 | + |
| 56 | + And I switch back to the app |
| 57 | + And I pull to refresh in the app |
| 58 | + Then I should find "Approved" near "Export all of my personal data" in the app |
| 59 | + When I run all adhoc tasks |
| 60 | + And I pull to refresh in the app |
| 61 | + And I should find "Download ready" near "Export all of my personal data" in the app |
| 62 | + # TODO: Add download link and test it. |
0 commit comments