MDL-68750 tool_dataprivacy: Correct behat test modal checks
[moodle.git] / admin / tool / dataprivacy / tests / behat / manage_purposes.feature
CommitLineData
91932265
JP
1@tool @tool_dataprivacy @javascript
2Feature: Manage data storage purposes
3 As the privacy officer
4 In order to manage the data registry
5 I need to be able to manage the data storage purposes for the data registry
6
7 Background:
8 Given I log in as "admin"
9 And I navigate to "Users > Privacy and policies > Data registry" in site administration
cfd390ee 10 And I open the action menu in "region-main" "region"
91932265
JP
11 And I choose "Purposes" in the open action menu
12 And I press "Add purpose"
13 And I set the field "Name" to "Purpose 1"
14 And I set the field "Description" to "Purpose 1 description"
15 And I click on ".form-autocomplete-downarrow" "css_element" in the "Lawful bases" "form_row"
16 And I click on "Contract (GDPR Art. 6.1(b))" "list_item"
17 And I click on "Legal obligation (GDPR Art 6.1(c))" "list_item"
18 And I press key "27" in the field "Lawful bases"
19 And I click on ".form-autocomplete-downarrow" "css_element" in the "Sensitive personal data processing reasons" "form_row"
20 And I click on "Explicit consent (GDPR Art. 9.2(a))" "list_item"
21 And I press key "27" in the field "Sensitive personal data processing reasons"
22 And I set the field "retentionperiodnumber" to "2"
23 When I press "Save"
24 Then I should see "Purpose 1" in the "List of data purposes" "table"
25 And I should see "Contract (GDPR Art. 6.1(b))" in the "Purpose 1" "table_row"
26 And I should see "Legal obligation (GDPR Art 6.1(c))" in the "Purpose 1" "table_row"
27 And I should see "Explicit consent (GDPR Art. 9.2(a))" in the "Purpose 1" "table_row"
28 And I should see "2 years" in the "Purpose 1" "table_row"
e1121c2e 29 And "Purpose 1 Purpose 1 description" row "5" column of "List of data purposes" table should contain "No"
91932265
JP
30
31 Scenario: Update a data storage purpose
cfd390ee 32 Given I open the action menu in "Purpose 1" "table_row"
91932265
JP
33 And I choose "Edit" in the open action menu
34 And I set the field "Name" to "Purpose 1 edited"
35 And I set the field "Description" to "Purpose 1 description edited"
36 And I click on "Legal obligation (GDPR Art 6.1(c))" "text" in the ".form-autocomplete-selection" "css_element"
37 And I click on ".form-autocomplete-downarrow" "css_element" in the "Lawful bases" "form_row"
38 And I click on "Vital interests (GDPR Art. 6.1(d))" "list_item"
39 And I press key "27" in the field "Lawful bases"
40 And I set the field "retentionperiodnumber" to "3"
41 And I click on "protected" "checkbox"
42 When I press "Save changes"
43 Then I should see "Purpose 1 edited" in the "List of data purposes" "table"
44 And I should see "Purpose 1 description edited" in the "Purpose 1 edited" "table_row"
45 And I should see "Vital interests (GDPR Art. 6.1(d))" in the "Purpose 1 edited" "table_row"
46 And I should see "3 years" in the "Purpose 1 edited" "table_row"
47 But I should not see "Legal obligation (GDPR Art 6.1(c))" in the "Purpose 1 edited" "table_row"
e1121c2e 48 And "Purpose 1 edited Purpose 1 description edited" row "5" column of "List of data purposes" table should not contain "No"
91932265
JP
49
50 Scenario: Delete a data storage purpose
cfd390ee 51 Given I open the action menu in "Purpose 1" "table_row"
91932265
JP
52 And I choose "Delete" in the open action menu
53 And I should see "Delete purpose"
1b070cfe 54 And I should see "Are you sure you want to delete the purpose 'Purpose 1'?"
ddf6e481 55 When I click on "Delete" "button" in the "Delete purpose" "dialogue"
91932265 56 Then I should not see "Purpose 1" in the "List of data purposes" "table"