1 |
efrain |
1 |
@core @core_courseformat @core_course @show_editor @javascript
|
|
|
2 |
Feature: Bulk course activity actions.
|
|
|
3 |
In order to edit the course activities
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to edit activities in bulk.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "course" exists:
|
|
|
9 |
| fullname | Course 1 |
|
|
|
10 |
| shortname | C1 |
|
|
|
11 |
| category | 0 |
|
|
|
12 |
| numsections | 4 |
|
|
|
13 |
| initsections | 1 |
|
|
|
14 |
And the following "activities" exist:
|
|
|
15 |
| activity | name | intro | course | idnumber | section |
|
|
|
16 |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
|
|
|
17 |
| assign | Activity sample 2 | Test assignment description | C1 | sample2 | 1 |
|
|
|
18 |
| assign | Activity sample 3 | Test assignment description | C1 | sample3 | 2 |
|
|
|
19 |
| assign | Activity sample 4 | Test assignment description | C1 | sample4 | 2 |
|
|
|
20 |
And the following "users" exist:
|
|
|
21 |
| username | firstname | lastname | email |
|
|
|
22 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
23 |
And the following "course enrolments" exist:
|
|
|
24 |
| user | course | role |
|
|
|
25 |
| teacher1 | C1 | editingteacher |
|
|
|
26 |
And the following config values are set as admin:
|
|
|
27 |
| allowstealth | 1 |
|
|
|
28 |
And I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
29 |
And I turn editing mode on
|
|
|
30 |
And I click on "Bulk actions" "button"
|
|
|
31 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
32 |
|
|
|
33 |
Scenario: Bulk hiding activities
|
|
|
34 |
Given I should not see "Hidden from students" in the "Activity sample 1" "activity"
|
|
|
35 |
And I should not see "Hidden from students" in the "Activity sample 2" "activity"
|
|
|
36 |
And I should not see "Hidden from students" in the "Activity sample 3" "activity"
|
|
|
37 |
And I should not see "Hidden from students" in the "Activity sample 4" "activity"
|
|
|
38 |
And I click on "Select activity Activity sample 1" "checkbox"
|
|
|
39 |
And I click on "Select activity Activity sample 3" "checkbox"
|
|
|
40 |
And I should see "2 selected" in the "sticky-footer" "region"
|
|
|
41 |
When I click on "Activity availability" "button" in the "sticky-footer" "region"
|
|
|
42 |
And I click on "Hide on course page" "radio" in the "Availability" "dialogue"
|
|
|
43 |
And I click on "Apply" "button" in the "Availability" "dialogue"
|
|
|
44 |
Then I should see "Hidden from students" in the "Activity sample 1" "activity"
|
|
|
45 |
And I should not see "Hidden from students" in the "Activity sample 2" "activity"
|
|
|
46 |
And I should see "Hidden from students" in the "Activity sample 3" "activity"
|
|
|
47 |
And I should not see "Hidden from students" in the "Activity sample 4" "activity"
|
|
|
48 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
49 |
|
|
|
50 |
Scenario: Bulk showing activities
|
|
|
51 |
Given the following "activities" exist:
|
|
|
52 |
| activity | name | intro | course | idnumber | section | visible |
|
|
|
53 |
| assign | Activity sample 5 | Test assignment description | C1 | sample5 | 1 | 0 |
|
|
|
54 |
| assign | Activity sample 6 | Test assignment description | C1 | sample6 | 2 | 0 |
|
|
|
55 |
And I reload the page
|
|
|
56 |
And I click on "Bulk actions" "button"
|
|
|
57 |
And I should not see "Hidden from students" in the "Activity sample 4" "activity"
|
|
|
58 |
And I should see "Hidden from students" in the "Activity sample 5" "activity"
|
|
|
59 |
And I should see "Hidden from students" in the "Activity sample 6" "activity"
|
|
|
60 |
And I click on "Select activity Activity sample 4" "checkbox"
|
|
|
61 |
And I click on "Select activity Activity sample 5" "checkbox"
|
|
|
62 |
And I click on "Select activity Activity sample 6" "checkbox"
|
|
|
63 |
And I should see "3 selected" in the "sticky-footer" "region"
|
|
|
64 |
When I click on "Activity availability" "button" in the "sticky-footer" "region"
|
|
|
65 |
And I click on "Show on course page" "radio" in the "Availability" "dialogue"
|
|
|
66 |
And I click on "Apply" "button" in the "Availability" "dialogue"
|
|
|
67 |
Then I should not see "Hidden from students" in the "Activity sample 4" "activity"
|
|
|
68 |
And I should not see "Hidden from students" in the "Activity sample 5" "activity"
|
|
|
69 |
And I should not see "Hidden from students" in the "Activity sample 6" "activity"
|
|
|
70 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
71 |
|
|
|
72 |
Scenario: Bulk stealth is only available if the site has stealth enabled
|
|
|
73 |
Given I click on "Select activity Activity sample 1" "checkbox"
|
|
|
74 |
And I should see "1 selected" in the "sticky-footer" "region"
|
|
|
75 |
And I click on "Activity availability" "button" in the "sticky-footer" "region"
|
|
|
76 |
And I should see "Make available" in the "Availability" "dialogue"
|
|
|
77 |
When the following config values are set as admin:
|
|
|
78 |
| allowstealth | 0 |
|
|
|
79 |
And I reload the page
|
|
|
80 |
And I click on "Bulk actions" "button"
|
|
|
81 |
Then I click on "Select activity Activity sample 1" "checkbox"
|
|
|
82 |
And I should see "1 selected" in the "sticky-footer" "region"
|
|
|
83 |
And I click on "Activity availability" "button" in the "sticky-footer" "region"
|
|
|
84 |
And I should not see "Make available" in the "Availability" "dialogue"
|
|
|
85 |
|
|
|
86 |
Scenario: Bulk stealth activities
|
|
|
87 |
Given I click on "Select activity Activity sample 1" "checkbox"
|
|
|
88 |
And I click on "Activity availability" "button" in the "sticky-footer" "region"
|
|
|
89 |
And I click on "Hide on course page" "radio" in the "Availability" "dialogue"
|
|
|
90 |
And I click on "Apply" "button" in the "Availability" "dialogue"
|
|
|
91 |
And I should see "Hidden from students" in the "Activity sample 1" "activity"
|
|
|
92 |
And I should not see "Available but not shown on course page" in the "Activity sample 3" "activity"
|
|
|
93 |
When I click on "Select activity Activity sample 1" "checkbox"
|
|
|
94 |
And I click on "Select activity Activity sample 3" "checkbox"
|
|
|
95 |
And I should see "2 selected" in the "sticky-footer" "region"
|
|
|
96 |
And I click on "Activity availability" "button" in the "sticky-footer" "region"
|
|
|
97 |
And I click on "Make available but don't show on course page" "radio" in the "Availability" "dialogue"
|
|
|
98 |
And I click on "Apply" "button" in the "Availability" "dialogue"
|
|
|
99 |
Then I should see "Available but not shown on course page" in the "Activity sample 1" "activity"
|
|
|
100 |
And I should see "Available but not shown on course page" in the "Activity sample 3" "activity"
|
|
|
101 |
|
|
|
102 |
Scenario: Bulk duplicate activities
|
|
|
103 |
Given I click on "Select activity Activity sample 1" "checkbox"
|
|
|
104 |
And I click on "Select activity Activity sample 3" "checkbox"
|
|
|
105 |
And I should see "2 selected" in the "sticky-footer" "region"
|
|
|
106 |
When I click on "Duplicate activities" "button" in the "sticky-footer" "region"
|
|
|
107 |
Then I should see "Activity sample 1" in the "Section 1" "section"
|
|
|
108 |
And I should see "Activity sample 1 (copy)" in the "Section 1" "section"
|
|
|
109 |
And "Activity sample 1 (copy)" "activity" should appear after "Activity sample 1" "activity"
|
|
|
110 |
And I should see "Activity sample 3" in the "Section 2" "section"
|
|
|
111 |
And I should see "Activity sample 3 (copy)" in the "Section 2" "section"
|
|
|
112 |
And "Activity sample 3 (copy)" "activity" should appear after "Activity sample 3" "activity"
|
|
|
113 |
|
|
|
114 |
Scenario: Bulk delete activities
|
|
|
115 |
Given I should see "Activity sample 1" in the "Section 1" "section"
|
|
|
116 |
And I should see "Activity sample 2" in the "Section 1" "section"
|
|
|
117 |
And I should see "Activity sample 3" in the "Section 2" "section"
|
|
|
118 |
And I should see "Activity sample 4" in the "Section 2" "section"
|
|
|
119 |
And I click on "Select activity Activity sample 1" "checkbox"
|
|
|
120 |
And I click on "Select activity Activity sample 3" "checkbox"
|
|
|
121 |
And I should see "2 selected" in the "sticky-footer" "region"
|
|
|
122 |
When I click on "Delete activities" "button" in the "sticky-footer" "region"
|
|
|
123 |
And I click on "Delete" "button" in the "Delete selected activities?" "dialogue"
|
|
|
124 |
Then I should not see "Activity sample 1" in the "Section 1" "section"
|
|
|
125 |
And I should see "Activity sample 2" in the "Section 1" "section"
|
|
|
126 |
And I should not see "Activity sample 3" in the "Section 2" "section"
|
|
|
127 |
And I should see "Activity sample 4" in the "Section 2" "section"
|
|
|
128 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
129 |
|
|
|
130 |
Scenario: Bulk move activities after a specific activity
|
|
|
131 |
Given I should see "Activity sample 1" in the "Section 1" "section"
|
|
|
132 |
And I should see "Activity sample 2" in the "Section 1" "section"
|
|
|
133 |
And I should see "Activity sample 3" in the "Section 2" "section"
|
|
|
134 |
And I should see "Activity sample 4" in the "Section 2" "section"
|
|
|
135 |
And I click on "Select activity Activity sample 1" "checkbox"
|
|
|
136 |
And I click on "Select activity Activity sample 3" "checkbox"
|
|
|
137 |
And I should see "2 selected" in the "sticky-footer" "region"
|
|
|
138 |
When I click on "Move activities" "button" in the "sticky-footer" "region"
|
|
|
139 |
And I click on "Activity sample 2" "link" in the "Move selected activities" "dialogue"
|
|
|
140 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
141 |
# Check activities are moved to the right sections.
|
|
|
142 |
Then I should see "Activity sample 1" in the "Section 1" "section"
|
|
|
143 |
And I should see "Activity sample 2" in the "Section 1" "section"
|
|
|
144 |
And I should see "Activity sample 3" in the "Section 1" "section"
|
|
|
145 |
And I should not see "Activity sample 3" in the "Section 2" "section"
|
|
|
146 |
And I should see "Activity sample 4" in the "Section 2" "section"
|
|
|
147 |
# Check new activities order.
|
|
|
148 |
And "Activity sample 1" "activity" should appear after "Activity sample 2" "activity"
|
|
|
149 |
And "Activity sample 3" "activity" should appear after "Activity sample 1" "activity"
|
|
|
150 |
And "Activity sample 4" "activity" should appear after "Activity sample 3" "activity"
|
|
|
151 |
|
|
|
152 |
Scenario: Bulk move activities after a specific section header
|
|
|
153 |
Given I should see "Activity sample 1" in the "Section 1" "section"
|
|
|
154 |
And I should see "Activity sample 2" in the "Section 1" "section"
|
|
|
155 |
And I should see "Activity sample 3" in the "Section 2" "section"
|
|
|
156 |
And I should see "Activity sample 4" in the "Section 2" "section"
|
|
|
157 |
And I click on "Select activity Activity sample 1" "checkbox"
|
|
|
158 |
And I click on "Select activity Activity sample 3" "checkbox"
|
|
|
159 |
And I should see "2 selected" in the "sticky-footer" "region"
|
|
|
160 |
When I click on "Move activities" "button" in the "sticky-footer" "region"
|
|
|
161 |
And I click on "Section 3" "link" in the "Move selected activities" "dialogue"
|
|
|
162 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
163 |
# Check activities are moved to the right sections.
|
|
|
164 |
Then I should see "Activity sample 1" in the "Section 3" "section"
|
|
|
165 |
Then I should not see "Activity sample 1" in the "Section 1" "section"
|
|
|
166 |
And I should see "Activity sample 2" in the "Section 1" "section"
|
|
|
167 |
And I should see "Activity sample 3" in the "Section 3" "section"
|
|
|
168 |
And I should not see "Activity sample 3" in the "Section 2" "section"
|
|
|
169 |
And I should see "Activity sample 4" in the "Section 2" "section"
|
|
|
170 |
# Check new activities order.
|
|
|
171 |
And "Activity sample 4" "activity" should appear after "Activity sample 2" "activity"
|
|
|
172 |
And "Activity sample 1" "activity" should appear after "Activity sample 4" "activity"
|
|
|
173 |
And "Activity sample 3" "activity" should appear after "Activity sample 1" "activity"
|