MDL-68750 tool_dataprivacy: Correct behat test modal checks
[moodle.git] / admin / tool / dataprivacy / tests / behat / manage_categories.feature
CommitLineData
91932265
JP
1@tool @tool_dataprivacy @javascript
2Feature: Manage data categories
3 As the privacy officer
4 In order to manage the data registry
5 I need to be able to manage the data categories 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 "Categories" in the open action menu
12 And I press "Add category"
13 And I set the field "Name" to "Category 1"
14 And I set the field "Description" to "Category 1 description"
ddf6e481 15 When I click on "Save" "button" in the "Add category" "dialogue"
91932265
JP
16 Then I should see "Category 1" in the "List of data categories" "table"
17 And I should see "Category 1 description" in the "Category 1" "table_row"
18
19 Scenario: Update a data category
cfd390ee 20 Given I open the action menu in "Category 1" "table_row"
91932265
JP
21 And I choose "Edit" in the open action menu
22 And I set the field "Name" to "Category 1 edited"
23 And I set the field "Description" to "Category 1 description edited"
24 When I press "Save changes"
25 Then I should see "Category 1 edited" in the "List of data categories" "table"
26 And I should see "Category 1 description edited" in the "List of data categories" "table"
27
28 Scenario: Delete a data category
cfd390ee 29 Given I open the action menu in "Category 1" "table_row"
91932265
JP
30 And I choose "Delete" in the open action menu
31 And I should see "Delete category"
1b070cfe 32 And I should see "Are you sure you want to delete the category 'Category 1'?"
ddf6e481 33 When I click on "Delete" "button" in the "Delete category" "dialogue"
91932265 34 Then I should not see "Category 1" in the "List of data categories" "table"