MDL-62026 tool_dataprivacy: Behat tests for contacting PO
[moodle.git] / admin / tool / dataprivacy / tests / behat / manage_data_requests.feature
blobbdc43e763f8cd1635c3a6a1efa44ee44b08b10ee
1 @tool @tool_dataprivacy
2 Feature: Manage data requests
3   As the privacy officer
4   In order to address the privacy-related requests
5   I need to be able to manage the data requests of the site's users
7   Background:
8     Given the following "users" exist:
9       | username | firstname | lastname | email          |
10       | student1 | John      | Doe      | s1@example.com |
11       | student2 | Jane      | Doe      | s2@example.com |
12     And I log in as "admin"
13     And I set the following administration settings values:
14       | contactdataprotectionofficer | 1 |
15     And I log out
17   @javascript
18   Scenario: Marking general enquiries as complete
19     Given I log in as "student1"
20     And I follow "Profile" in the user menu
21     And I should see "Contact the privacy officer"
22     And I click on "Contact the privacy officer" "link"
23     And I set the field "Message" to "Hi PO! Can others access my information on your site?"
24     And I press "Send"
25     And I should see "Your request has been submitted to the privacy officer"
26     And I log out
27     And I log in as "student2"
28     And I follow "Profile" in the user menu
29     And I click on "Contact the privacy officer" "link"
30     And I set the field "Message" to "Dear Mr. Privacy Officer, I'd like to know more about GDPR. Thanks!"
31     And I press "Send"
32     And I should see "Your request has been submitted to the privacy officer"
33     And I log out
34     When I log in as "admin"
35     And I navigate to "Users > Privacy and policies > Data requests" in site administration
36     Then I should see "Hi PO!" in the "John Doe" "table_row"
37     And I should see "Dear Mr. Privacy Officer" in the "Jane Doe" "table_row"
38     And I click on "Actions" "link" in the "John Doe" "table_row"
39     And I should see "View the request"
40     And I should see "Mark as complete"
41     And I choose "View the request" in the open action menu
42     And I should see "Hi PO! Can others access my information on your site?"
43     And I press "Mark as complete"
44     And I wait until the page is ready
45     And I should see "Complete" in the "John Doe" "table_row"
46     And I click on "Actions" "link" in the "John Doe" "table_row"
47     And I should see "View the request"
48     But I should not see "Mark as complete"
49     And I press key "27" in ".moodle-actionmenu" "css_element"
50     And I click on "Actions" "link" in the "Jane Doe" "table_row"
51     And I choose "Mark as complete" in the open action menu
52     And I should see "Do you really want to mark this user enquiry as complete?"
53     And I press "Mark as complete"
54     And I wait until the page is ready
55     And I should see "Complete" in the "Jane Doe" "table_row"
56     And I click on "Actions" "link" in the "Jane Doe" "table_row"
57     And I should see "View the request"
58     But I should not see "Mark as complete"