1 |
efrain |
1 |
@mod @mod_forum @forumreport @forumreport_summary
|
|
|
2 |
Feature: Groups report filter is available if groups exist
|
|
|
3 |
In order to retrieve targeted forum data
|
|
|
4 |
As a teacher
|
|
|
5 |
I can filter the forum summary report by groups of users
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
| student2 | Student | 2 | student1@example.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
16 |
| Course 2 | C2 | 0 |
|
|
|
17 |
And the following "course enrolments" exist:
|
|
|
18 |
| user | course | role |
|
|
|
19 |
| teacher1 | C1 | editingteacher |
|
|
|
20 |
| student1 | C1 | student |
|
|
|
21 |
| student2 | C1 | student |
|
|
|
22 |
| teacher1 | C2 | editingteacher |
|
|
|
23 |
And the following "groups" exist:
|
|
|
24 |
| name | course | idnumber |
|
|
|
25 |
| Group A | C1 | G1 |
|
|
|
26 |
| Group B | C1 | G2 |
|
|
|
27 |
| Group C | C1 | G3 |
|
|
|
28 |
| Group D | C1 | G4 |
|
|
|
29 |
| Group E | C2 | G5 |
|
|
|
30 |
And the following "group members" exist:
|
|
|
31 |
| user | group |
|
|
|
32 |
| teacher1 | G1 |
|
|
|
33 |
| teacher1 | G2 |
|
|
|
34 |
| teacher1 | G3 |
|
|
|
35 |
| student1 | G3 |
|
|
|
36 |
And the following "activities" exist:
|
|
|
37 |
| activity | name | course | idnumber | groupmode |
|
|
|
38 |
| forum | forum1 | C1 | c1forum1 | 1 |
|
|
|
39 |
| forum | forum2 | C1 | c1forum2 | 2 |
|
|
|
40 |
| forum | forum1 | C2 | c2forum1 | 0 |
|
|
|
41 |
And the following forum discussions exist in course "Course 1":
|
|
|
42 |
| user | forum | name | message | group | created |
|
|
|
43 |
| teacher1 | forum1 | discussion1 | D1 message | G1 | ## 1 month ago ## |
|
|
|
44 |
| teacher1 | forum1 | discussion2 | D2 message | G2 | ## 1 week ago ## |
|
|
|
45 |
| teacher1 | forum2 | discussion3 | D3 message | G1 | ## 6 days ago ## |
|
|
|
46 |
| teacher1 | forum2 | discussion4 | D4 message | G4 | ## 5 days ago ## |
|
|
|
47 |
| teacher1 | forum2 | discussion5 | D5 message | All participants | ## 4 days ago ## |
|
|
|
48 |
| student1 | forum1 | discussion6 | D6 message | G3 | ## 3 days ago ## |
|
|
|
49 |
| student2 | forum2 | discussion7 | D7 message | All participants | ## 2 days ago ## |
|
|
|
50 |
And the following forum replies exist in course "Course 1":
|
|
|
51 |
| user | forum | discussion | message | created |
|
|
|
52 |
| teacher1 | forum1 | discussion1 | D1 reply | ## 3 weeks ago ## |
|
|
|
53 |
| teacher1 | forum2 | discussion3 | D3 reply | ## 4 days ago ## |
|
|
|
54 |
| teacher1 | forum1 | discussion6 | D6 reply | ## 2 days ago ## |
|
|
|
55 |
| student1 | forum1 | discussion6 | D6 reply 2 | ## 2 days ago ## |
|
|
|
56 |
| student2 | forum2 | discussion4 | D4 reply | ## 4 days ago ## |
|
|
|
57 |
| student2 | forum2 | discussion5 | D5 reply | ## 3 days ago ## |
|
|
|
58 |
And the following forum discussions exist in course "Course 2":
|
|
|
59 |
| user | forum | name | message | created |
|
|
|
60 |
| teacher1 | forum1 | discussion1 | D1 other course | ## 1 week ago ## |
|
|
|
61 |
| teacher1 | forum1 | discussion2 | D2 other course | ## 4 days ago ## |
|
|
|
62 |
|
|
|
63 |
@javascript
|
|
|
64 |
Scenario: All groups can be selected or cleared together in the groups filter, and are unchecked by default
|
|
|
65 |
When I am on the "c1forum1" "forum activity" page logged in as teacher1
|
|
|
66 |
And I navigate to "Reports" in current page administration
|
|
|
67 |
Then "Groups" "button" should exist
|
|
|
68 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
69 |
# | | Discussions | Replies |
|
11 |
efrain |
70 |
| First name | -3- | -4- |
|
1 |
efrain |
71 |
| Student 1 | 1 | 1 |
|
|
|
72 |
| Student 2 | 0 | 0 |
|
|
|
73 |
| Teacher 1 | 2 | 2 |
|
|
|
74 |
And I click on "Groups" "button"
|
|
|
75 |
And "Group A" "checkbox" should exist in the "filter-groups-popover" "region"
|
|
|
76 |
And "Group B" "checkbox" should exist in the "filter-groups-popover" "region"
|
|
|
77 |
And "Group C" "checkbox" should exist in the "filter-groups-popover" "region"
|
|
|
78 |
And "Group D" "checkbox" should exist in the "filter-groups-popover" "region"
|
|
|
79 |
And "No groups" "checkbox" should exist in the "filter-groups-popover" "region"
|
|
|
80 |
And "Group E" "checkbox" should not exist in the "filter-groups-popover" "region"
|
|
|
81 |
And the following fields match these values:
|
|
|
82 |
| Group A | 0 |
|
|
|
83 |
| Group B | 0 |
|
|
|
84 |
| Group C | 0 |
|
|
|
85 |
| Group D | 0 |
|
|
|
86 |
| No groups | 0 |
|
|
|
87 |
And I click on "Select all" "button" in the "filter-groups-popover" "region"
|
|
|
88 |
And the following fields match these values:
|
|
|
89 |
| Group A | 1 |
|
|
|
90 |
| Group B | 1 |
|
|
|
91 |
| Group C | 1 |
|
|
|
92 |
| Group D | 1 |
|
|
|
93 |
| No groups | 1 |
|
|
|
94 |
And I click on "Clear" "button" in the "filter-groups-popover" "region"
|
|
|
95 |
And the following fields match these values:
|
|
|
96 |
| Group A | 0 |
|
|
|
97 |
| Group B | 0 |
|
|
|
98 |
| Group C | 0 |
|
|
|
99 |
| Group D | 0 |
|
|
|
100 |
| No groups | 0 |
|
|
|
101 |
And I click on "Select all" "button" in the "filter-groups-popover" "region"
|
|
|
102 |
And I click on "Save" "button" in the "filter-groups-popover" "region"
|
|
|
103 |
And "Groups (all)" "button" should exist
|
|
|
104 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
105 |
# | | Discussions | Replies |
|
11 |
efrain |
106 |
| First name | -3- | -4- |
|
1 |
efrain |
107 |
| Student 1 | 1 | 1 |
|
|
|
108 |
| Student 2 | 0 | 0 |
|
|
|
109 |
| Teacher 1 | 2 | 2 |
|
|
|
110 |
|
|
|
111 |
@javascript
|
|
|
112 |
Scenario: The summary report can be filtered by a subset of groups, and re-ordering the results retains the filter
|
|
|
113 |
When I am on the "c1forum1" "forum activity" page logged in as teacher1
|
|
|
114 |
And I navigate to "Reports" in current page administration
|
|
|
115 |
Then "Groups" "button" should exist
|
|
|
116 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
117 |
# | | Discussions | Replies |
|
11 |
efrain |
118 |
| First name | -3- | -4- |
|
1 |
efrain |
119 |
| Student 1 | 1 | 1 |
|
|
|
120 |
| Student 2 | 0 | 0 |
|
|
|
121 |
| Teacher 1 | 2 | 2 |
|
|
|
122 |
And I click on "Groups" "button"
|
|
|
123 |
And I click on "Clear" "button" in the "filter-groups-popover" "region"
|
|
|
124 |
And I click on "Group A" "checkbox" in the "filter-groups-popover" "region"
|
|
|
125 |
And I click on "Group C" "checkbox" in the "filter-groups-popover" "region"
|
|
|
126 |
And I click on "Group D" "checkbox" in the "filter-groups-popover" "region"
|
|
|
127 |
And I click on "Save" "button"
|
|
|
128 |
And "Groups (3)" "button" should exist
|
|
|
129 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
130 |
# | | Discussions | Replies |
|
11 |
efrain |
131 |
| First name | -3- | -4- |
|
1 |
efrain |
132 |
| Student 1 | 1 | 1 |
|
|
|
133 |
| Teacher 1 | 1 | 2 |
|
|
|
134 |
And I should not see "Student 2"
|
|
|
135 |
# Ensure re-ordering retains filter.
|
|
|
136 |
And I click on "Number of discussions posted" "link"
|
|
|
137 |
And "Groups (3)" "button" should exist
|
|
|
138 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
139 |
# | | Discussions | Replies |
|
11 |
efrain |
140 |
| First name | -3- | -4- |
|
1 |
efrain |
141 |
| Student 1 | 1 | 1 |
|
|
|
142 |
| Teacher 1 | 1 | 2 |
|
|
|
143 |
And I should not see "Student 2"
|
|
|
144 |
|
|
|
145 |
@javascript
|
|
|
146 |
Scenario: The summary report can be filtered as a mixture of groups and no groups
|
|
|
147 |
When I am on the "c1forum2" "forum activity" page logged in as teacher1
|
|
|
148 |
And I navigate to "Reports" in current page administration
|
|
|
149 |
Then "Groups" "button" should exist
|
|
|
150 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
151 |
# | | Discussions | Replies |
|
11 |
efrain |
152 |
| First name | -3- | -4- |
|
1 |
efrain |
153 |
| Student 1 | 0 | 0 |
|
|
|
154 |
| Student 2 | 1 | 2 |
|
|
|
155 |
| Teacher 1 | 3 | 1 |
|
|
|
156 |
And I click on "Groups" "button"
|
|
|
157 |
And I click on "Clear" "button" in the "filter-groups-popover" "region"
|
|
|
158 |
And I click on "Group A" "checkbox" in the "filter-groups-popover" "region"
|
|
|
159 |
And I click on "No groups" "checkbox" in the "filter-groups-popover" "region"
|
|
|
160 |
And I click on "Save" "button" in the "filter-groups-popover" "region"
|
|
|
161 |
And "Groups (2)" "button" should exist
|
|
|
162 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
163 |
# | | Discussions | Replies |
|
11 |
efrain |
164 |
| First name | -3- | -4- |
|
1 |
efrain |
165 |
| Student 1 | 0 | 0 |
|
|
|
166 |
| Student 2 | 1 | 1 |
|
|
|
167 |
| Teacher 1 | 2 | 1 |
|
|
|
168 |
|
|
|
169 |
@javascript
|
|
|
170 |
Scenario: The summary report can be filtered by no groups only
|
|
|
171 |
When I am on the "c1forum2" "forum activity" page logged in as teacher1
|
|
|
172 |
And I navigate to "Reports" in current page administration
|
|
|
173 |
Then the following should exist in the "forumreport_summary_table" table:
|
|
|
174 |
# | | Discussions | Replies |
|
11 |
efrain |
175 |
| First name | -3- | -4- |
|
1 |
efrain |
176 |
| Student 1 | 0 | 0 |
|
|
|
177 |
| Student 2 | 1 | 2 |
|
|
|
178 |
| Teacher 1 | 3 | 1 |
|
|
|
179 |
And I click on "Groups" "button"
|
|
|
180 |
And I click on "Clear" "button" in the "filter-groups-popover" "region"
|
|
|
181 |
And I click on "No groups" "checkbox" in the "filter-groups-popover" "region"
|
|
|
182 |
And I click on "Save" "button" in the "filter-groups-popover" "region"
|
|
|
183 |
And "Groups (1)" "button" should exist
|
|
|
184 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
185 |
# | | Discussions | Replies |
|
11 |
efrain |
186 |
| First name | -3- | -4- |
|
1 |
efrain |
187 |
| Student 1 | 0 | 0 |
|
|
|
188 |
| Student 2 | 1 | 1 |
|
|
|
189 |
| Teacher 1 | 1 | 0 |
|
|
|
190 |
|
|
|
191 |
@javascript
|
|
|
192 |
Scenario: Filtering by a group containing no users still allows the page to render
|
|
|
193 |
# Log in as admin so Teacher 1 not existing on page can be confirmed.
|
|
|
194 |
When I am on the "c1forum1" "forum activity" page logged in as admin
|
|
|
195 |
And I navigate to "Reports" in current page administration
|
|
|
196 |
Then "Groups" "button" should exist
|
|
|
197 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
198 |
# | | Discussions | Replies |
|
11 |
efrain |
199 |
| First name | -3- | -4- |
|
1 |
efrain |
200 |
| Student 1 | 1 | 1 |
|
|
|
201 |
| Student 2 | 0 | 0 |
|
|
|
202 |
| Teacher 1 | 2 | 2 |
|
|
|
203 |
And I click on "Groups" "button"
|
|
|
204 |
And I click on "Clear" "button" in the "filter-groups-popover" "region"
|
|
|
205 |
And I click on "Group D" "checkbox" in the "filter-groups-popover" "region"
|
|
|
206 |
And I click on "Save" "button" in the "filter-groups-popover" "region"
|
|
|
207 |
And "Groups (1)" "button" should exist
|
|
|
208 |
And I should see "Nothing to display"
|
|
|
209 |
And I should not see "Teacher 1"
|
|
|
210 |
And I should not see "Student 1"
|
|
|
211 |
And I should not see "Student 2"
|
|
|
212 |
And I should not see "With selected users..."
|
|
|
213 |
And I should not see "Download table data as"
|
|
|
214 |
|
|
|
215 |
@javascript
|
|
|
216 |
Scenario: Course forum summary report can be filtered by group
|
|
|
217 |
When I am on the "c1forum2" "forum activity" page logged in as teacher1
|
|
|
218 |
And I navigate to "Reports" in current page administration
|
|
|
219 |
And I select "All forums in course" from the "Forum selected" singleselect
|
|
|
220 |
And I click on "Groups" "button"
|
|
|
221 |
And I click on "Clear" "button" in the "filter-groups-popover" "region"
|
|
|
222 |
And I click on "Group A" "checkbox" in the "filter-groups-popover" "region"
|
|
|
223 |
And I click on "Group C" "checkbox" in the "filter-groups-popover" "region"
|
|
|
224 |
And I click on "Save" "button"
|
|
|
225 |
And "Groups (2)" "button" should exist
|
|
|
226 |
Then the following should exist in the "forumreport_summary_table" table:
|
|
|
227 |
# | | Discussions | Replies |
|
11 |
efrain |
228 |
| First name | -3- | -4- |
|
1 |
efrain |
229 |
| Student 1 | 1 | 1 |
|
|
|
230 |
| Teacher 1 | 2 | 3 |
|
|
|
231 |
And I should not see "Student 2"
|
|
|
232 |
# Ensure re-ordering retains filter.
|
|
|
233 |
And I click on "Number of discussions posted" "link"
|
|
|
234 |
And "Groups (2)" "button" should exist
|
|
|
235 |
And the following should exist in the "forumreport_summary_table" table:
|
|
|
236 |
# | | Discussions | Replies |
|
11 |
efrain |
237 |
| First name | -3- | -4- |
|
1 |
efrain |
238 |
| Student 1 | 1 | 1 |
|
|
|
239 |
| Teacher 1 | 2 | 3 |
|
|
|
240 |
And I should not see "Student 2"
|