1 |
efrain |
1 |
@tool @tool_recyclebin
|
|
|
2 |
Feature: Basic recycle bin functionality
|
|
|
3 |
As a teacher
|
|
|
4 |
I want be able to recover deleted content and manage the recycle bin content
|
|
|
5 |
So that I can fix an accidental deletion and clean the recycle bin
|
|
|
6 |
|
|
|
7 |
Background: Course with teacher exists.
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher@asd.com |
|
|
|
11 |
| student1 | Student | 1 | student@asd.com |
|
|
|
12 |
| student2 | Student | 2 | student2@asd.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | initsections |
|
|
|
15 |
| Course 1 | C1 | 1 |
|
|
|
16 |
| Course 2 | C2 | 0 |
|
|
|
17 |
And the following "activities" exist:
|
|
|
18 |
| activity | course | section | name | intro |
|
|
|
19 |
| assign | C1 | 1 | Test assign 1 | Test 1 |
|
|
|
20 |
| assign | C1 | 1 | Test assign 2 | Test 2 |
|
|
|
21 |
And the following "course enrolments" exist:
|
|
|
22 |
| user | course | role |
|
|
|
23 |
| teacher1 | C1 | editingteacher |
|
|
|
24 |
| student1 | C1 | student |
|
|
|
25 |
| student2 | C1 | student |
|
|
|
26 |
| teacher1 | C2 | editingteacher |
|
|
|
27 |
| student1 | C2 | student |
|
|
|
28 |
| student2 | C2 | student |
|
|
|
29 |
And the following "groups" exist:
|
|
|
30 |
| name | course | idnumber |
|
|
|
31 |
| Group A | C2 | G1 |
|
|
|
32 |
| Group B | C2 | G2 |
|
|
|
33 |
| Group C | C2 | G3 |
|
|
|
34 |
And the following "group members" exist:
|
|
|
35 |
| user | group |
|
|
|
36 |
| teacher1 | G1 |
|
|
|
37 |
| teacher1 | G2 |
|
|
|
38 |
| student1 | G1 |
|
|
|
39 |
| student2 | G1 |
|
|
|
40 |
| student2 | G2 |
|
|
|
41 |
And the following config values are set as admin:
|
|
|
42 |
| coursebinenable | 1 | tool_recyclebin |
|
|
|
43 |
| categorybinenable | 1 | tool_recyclebin |
|
|
|
44 |
| coursebinexpiry | 604800 | tool_recyclebin |
|
|
|
45 |
| categorybinexpiry | 1209600 | tool_recyclebin |
|
|
|
46 |
| autohide | 0 | tool_recyclebin |
|
|
|
47 |
|
|
|
48 |
Scenario: Restore a deleted assignment
|
|
|
49 |
Given I log in as "teacher1"
|
|
|
50 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
51 |
And I delete "Test assign 1" activity
|
|
|
52 |
When I navigate to "Recycle bin" in current page administration
|
|
|
53 |
Then I should see "Test assign 1"
|
|
|
54 |
And I should see "Contents will be permanently deleted after 7 days"
|
|
|
55 |
And I click on "Restore" "link" in the "region-main" "region"
|
|
|
56 |
And I should see "'Test assign 1' has been restored"
|
|
|
57 |
And I wait to be redirected
|
|
|
58 |
And I am on "Course 1" course homepage
|
|
|
59 |
And I should see "Test assign 1" in the "Section 1" "section"
|
|
|
60 |
|
|
|
61 |
@javascript
|
|
|
62 |
Scenario: Restore a deleted course
|
|
|
63 |
Given I log in as "admin"
|
|
|
64 |
And I go to the courses management page
|
|
|
65 |
And I click on "delete" action for "Course 2" in management course listing
|
|
|
66 |
And I press "Delete"
|
|
|
67 |
And I should see "Deleting C2"
|
|
|
68 |
And I should see "C2 has been completely deleted"
|
|
|
69 |
And I press "Continue"
|
|
|
70 |
And I am on course index
|
|
|
71 |
And I should see "Course 1"
|
|
|
72 |
And I should not see "Course 2"
|
|
|
73 |
When I navigate to "Recycle bin" in current page administration
|
|
|
74 |
Then I should see "Course 2"
|
|
|
75 |
And I should see "Contents will be permanently deleted after 14 days"
|
|
|
76 |
And I click on "Restore" "link" in the "region-main" "region"
|
|
|
77 |
And I should see "'Course 2' has been restored"
|
|
|
78 |
And I wait to be redirected
|
|
|
79 |
And I go to the courses management page
|
|
|
80 |
And I should see "Course 2" in the "#course-listing" "css_element"
|
|
|
81 |
And I am on the "Course 2" "groups overview" page
|
|
|
82 |
And "Student 1" "text" should exist in the "Group A" "table_row"
|
|
|
83 |
And "Student 2" "text" should exist in the "Group A" "table_row"
|
|
|
84 |
And "Student 2" "text" should exist in the "Group B" "table_row"
|
|
|
85 |
|
|
|
86 |
@javascript
|
|
|
87 |
Scenario: Deleting a single item from the recycle bin
|
|
|
88 |
Given I log in as "teacher1"
|
|
|
89 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
90 |
And I delete "Test assign 1" activity
|
|
|
91 |
And I run all adhoc tasks
|
|
|
92 |
And I navigate to "Recycle bin" in current page administration
|
|
|
93 |
When I click on "Delete" "link"
|
|
|
94 |
Then I should see "Are you sure you want to delete the selected item from the recycle bin?"
|
|
|
95 |
And I click on "Cancel" "button" in the "Confirmation" "dialogue"
|
|
|
96 |
And I should see "Test assign 1"
|
|
|
97 |
And I click on "Delete" "link"
|
|
|
98 |
And I press "Yes"
|
|
|
99 |
And I should see "'Test assign 1' has been deleted"
|
|
|
100 |
And I should see "There are no items in the recycle bin."
|
|
|
101 |
|
|
|
102 |
@javascript
|
|
|
103 |
Scenario: Deleting all the items from the recycle bin
|
|
|
104 |
Given I log in as "teacher1"
|
|
|
105 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
106 |
And I delete "Test assign 1" activity
|
|
|
107 |
And I delete "Test assign 2" activity
|
|
|
108 |
And I run all adhoc tasks
|
|
|
109 |
And I navigate to "Recycle bin" in current page administration
|
|
|
110 |
And I should see "Test assign 1"
|
|
|
111 |
And I should see "Test assign 2"
|
|
|
112 |
When I click on "Delete all" "link"
|
|
|
113 |
Then I should see "Are you sure you want to delete all items from the recycle bin?"
|
|
|
114 |
And I click on "Cancel" "button" in the "Confirmation" "dialogue"
|
|
|
115 |
And I should see "Test assign 1"
|
|
|
116 |
And I should see "Test assign 2"
|
|
|
117 |
And I click on "Delete all" "link"
|
|
|
118 |
And I press "Yes"
|
|
|
119 |
And I should see "Recycle bin has been emptied"
|
|
|
120 |
And I should see "There are no items in the recycle bin."
|
|
|
121 |
|
|
|
122 |
@javascript
|
|
|
123 |
Scenario: Show recycle bin on category action menu
|
|
|
124 |
Given I log in as "admin"
|
|
|
125 |
And I navigate to "Courses > Manage courses and categories" in site administration
|
|
|
126 |
And I navigate to "Recycle bin" in current page administration
|
|
|
127 |
Then I should see "There are no items in the recycle bin."
|
|
|
128 |
|
|
|
129 |
@javascript
|
|
|
130 |
Scenario: Not show recycle bin empty on category action menu whit autohide enable
|
|
|
131 |
Given I log in as "admin"
|
|
|
132 |
And the following config values are set as admin:
|
|
|
133 |
| categorybinenable | 0 | tool_recyclebin |
|
|
|
134 |
And I navigate to "Courses > Manage courses and categories" in site administration
|
|
|
135 |
And I click on "Actions menu" "link"
|
|
|
136 |
Then I should not see "Recycle bin"
|
|
|
137 |
|
|
|
138 |
@javascript
|
|
|
139 |
Scenario: Show recycle bin not empty on category action menu whit autohide enable
|
|
|
140 |
Given I log in as "admin"
|
|
|
141 |
And the following config values are set as admin:
|
|
|
142 |
| autohide | 1 | tool_recyclebin |
|
|
|
143 |
And I navigate to "Courses > Manage courses and categories" in site administration
|
|
|
144 |
And I click on "Actions menu" "link"
|
|
|
145 |
Then I should not see "Recycle bin"
|
|
|
146 |
And I click on "delete" action for "Course 2" in management course listing
|
|
|
147 |
And I press "Delete"
|
|
|
148 |
And I should see "Deleting C2"
|
|
|
149 |
And I should see "C2 has been completely deleted"
|
|
|
150 |
And I press "Continue"
|
|
|
151 |
When I click on "Actions menu" "link"
|
|
|
152 |
Then I should see "Recycle bin"
|