mirrored from git://git.moodle.org/moodle.git
/
view_participants.feature
282 lines (271 loc) · 15 KB
/
view_participants.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
@core @core_user
Feature: View course participants
In order to know who is on a course
As a teacher
I need to be able to view the participants on a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1x | Teacher | 1x | teacher1x@example.com |
| student0x | Student | 0x | student0x@example.com |
| student1x | Student | 1x | student1x@example.com |
| student2x | Student | 2x | student2x@example.com |
| student3x | Student | 3x | student3x@example.com |
| student4x | Student | 4x | student4x@example.com |
| student5x | Student | 5x | student5x@example.com |
| student6x | Student | 6x | student6x@example.com |
| student7x | Student | 7x | student7x@example.com |
| student8x | Student | 8x | student8x@example.com |
| student9x | Student | 9x | student9x@example.com |
| student10x | Student | 10x | student10x@example.com |
| student11x | Student | 11x | student11x@example.com |
| student12x | Student | 12x | student12x@example.com |
| student13x | Student | 13x | student13x@example.com |
| student14x | Student | 14x | student14x@example.com |
| student15x | Student | 15x | student15x@example.com |
| student16x | Student | 16x | student16x@example.com |
| student17x | Student | 17x | student17x@example.com |
| student18x | Student | 18x | student18x@example.com |
| student19x | Student | 19x | student19x@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role | status | timeend |
| teacher1x | C1 | editingteacher | 0 | 0 |
| student0x | C1 | student | 0 | 0 |
| student1x | C1 | student | 0 | 0 |
| student2x | C1 | student | 0 | 0 |
| student3x | C1 | student | 0 | 0 |
| student4x | C1 | student | 0 | 0 |
| student5x | C1 | student | 0 | 0 |
| student6x | C1 | student | 0 | 0 |
| student7x | C1 | student | 0 | 0 |
| student8x | C1 | student | 0 | 0 |
| student9x | C1 | student | 0 | 0 |
| student10x | C1 | student | 1 | 0 |
| student11x | C1 | student | 0 | 100 |
| student12x | C1 | student | 0 | 0 |
| student13x | C1 | student | 0 | 0 |
| student14x | C1 | student | 0 | 0 |
| student15x | C1 | student | 0 | 0 |
| student16x | C1 | student | 0 | 0 |
| student17x | C1 | student | 0 | 0 |
| student18x | C1 | student | 0 | 0 |
@javascript
Scenario: Use select and deselect all buttons
Given I log in as "teacher1x"
And I am on "Course 1" course homepage
And I navigate to course participants
When I click on "Select all" "checkbox"
Then the field "Select 'Teacher 1x'" matches value "1"
And the field "Select 'Student 0x'" matches value "1"
And the field "Select 'Student 1x'" matches value "1"
And the field "Select 'Student 2x'" matches value "1"
And the field "Select 'Student 3x'" matches value "1"
And the field "Select 'Student 4x'" matches value "1"
And the field "Select 'Student 5x'" matches value "1"
And the field "Select 'Student 6x'" matches value "1"
And the field "Select 'Student 7x'" matches value "1"
And the field "Select 'Student 8x'" matches value "1"
And the field "Select 'Student 9x'" matches value "1"
And the field "Select 'Student 10x'" matches value "1"
And the field "Select 'Student 11x'" matches value "1"
And the field "Select 'Student 12x'" matches value "1"
And the field "Select 'Student 13x'" matches value "1"
And the field "Select 'Student 14x'" matches value "1"
And the field "Select 'Student 14x'" matches value "1"
And the field "Select 'Student 15x'" matches value "1"
And the field "Select 'Student 16x'" matches value "1"
And the field "Select 'Student 17x'" matches value "1"
And the field "Select 'Student 18x'" matches value "1"
And I click on "Deselect all" "checkbox"
And the field "Select 'Teacher 1x'" matches value "0"
And the field "Select 'Student 0x'" matches value "0"
And the field "Select 'Student 1x'" matches value "0"
And the field "Select 'Student 2x'" matches value "0"
And the field "Select 'Student 3x'" matches value "0"
And the field "Select 'Student 4x'" matches value "0"
And the field "Select 'Student 5x'" matches value "0"
And the field "Select 'Student 6x'" matches value "0"
And the field "Select 'Student 7x'" matches value "0"
And the field "Select 'Student 8x'" matches value "0"
And the field "Select 'Student 9x'" matches value "0"
And the field "Select 'Student 10x'" matches value "0"
And the field "Select 'Student 11x'" matches value "0"
And the field "Select 'Student 12x'" matches value "0"
And the field "Select 'Student 13x'" matches value "0"
And the field "Select 'Student 14x'" matches value "0"
And the field "Select 'Student 14x'" matches value "0"
And the field "Select 'Student 15x'" matches value "0"
And the field "Select 'Student 16x'" matches value "0"
And the field "Select 'Student 17x'" matches value "0"
And the field "Select 'Student 18x'" matches value "0"
Scenario: Sort and paginate the list of users
Given I log in as "teacher1x"
And the following "course enrolments" exist:
| user | course | role |
| student19x | C1 | student |
And I am on "Course 1" course homepage
And I navigate to course participants
And I follow "Email address"
When I click on "2" "link" in the "//nav[@aria-label='Page']" "xpath_element"
Then I should not see "student0x@example.com"
And I should not see "student19x@example.com"
And I should see "teacher1x@example.com"
And I follow "Email address"
And I click on "2" "link" in the "//nav[@aria-label='Page']" "xpath_element"
And I should not see "teacher1x@example.com"
And I should not see "student19x@example.com"
And I should not see "student1x@example.com"
And I should see "student0x@example.com"
@javascript
Scenario: Use select all users on this page, select all users and deselect all
Given the following "course enrolments" exist:
| user | course | role |
| student19x | C1 | student |
When I log in as "teacher1x"
And I am on "Course 1" course homepage
And I navigate to course participants
And I follow "Surname"
And I click on "Select all" "checkbox"
Then I should not see "Student 9x"
And the field "Select 'Teacher 1x'" matches value "1"
And the field "Select 'Student 0x'" matches value "1"
And the field "Select 'Student 1x'" matches value "1"
And the field "Select 'Student 2x'" matches value "1"
And the field "Select 'Student 3x'" matches value "1"
And the field "Select 'Student 4x'" matches value "1"
And the field "Select 'Student 5x'" matches value "1"
And the field "Select 'Student 6x'" matches value "1"
And the field "Select 'Student 7x'" matches value "1"
And the field "Select 'Student 8x'" matches value "1"
And the field "Select 'Student 10x'" matches value "1"
And the field "Select 'Student 11x'" matches value "1"
And the field "Select 'Student 12x'" matches value "1"
And the field "Select 'Student 13x'" matches value "1"
And the field "Select 'Student 14x'" matches value "1"
And the field "Select 'Student 14x'" matches value "1"
And the field "Select 'Student 15x'" matches value "1"
And the field "Select 'Student 16x'" matches value "1"
And the field "Select 'Student 17x'" matches value "1"
And the field "Select 'Student 18x'" matches value "1"
And the field "Select 'Student 19x'" matches value "1"
And I click on "Deselect all" "checkbox"
And the field "Select 'Teacher 1x'" matches value "0"
And the field "Select 'Student 0x'" matches value "0"
And the field "Select 'Student 1x'" matches value "0"
And the field "Select 'Student 2x'" matches value "0"
And the field "Select 'Student 3x'" matches value "0"
And the field "Select 'Student 4x'" matches value "0"
And the field "Select 'Student 5x'" matches value "0"
And the field "Select 'Student 6x'" matches value "0"
And the field "Select 'Student 7x'" matches value "0"
And the field "Select 'Student 8x'" matches value "0"
And the field "Select 'Student 10x'" matches value "0"
And the field "Select 'Student 11x'" matches value "0"
And the field "Select 'Student 12x'" matches value "0"
And the field "Select 'Student 13x'" matches value "0"
And the field "Select 'Student 14x'" matches value "0"
And the field "Select 'Student 14x'" matches value "0"
And the field "Select 'Student 15x'" matches value "0"
And the field "Select 'Student 16x'" matches value "0"
And the field "Select 'Student 17x'" matches value "0"
And the field "Select 'Student 18x'" matches value "0"
And the field "Select 'Student 19x'" matches value "0"
And I press "Select all 21 users"
And I should see "Student 9x"
And the field "Select 'Teacher 1x'" matches value "1"
And the field "Select 'Student 0x'" matches value "1"
And the field "Select 'Student 1x'" matches value "1"
And the field "Select 'Student 2x'" matches value "1"
And the field "Select 'Student 3x'" matches value "1"
And the field "Select 'Student 4x'" matches value "1"
And the field "Select 'Student 5x'" matches value "1"
And the field "Select 'Student 6x'" matches value "1"
And the field "Select 'Student 7x'" matches value "1"
And the field "Select 'Student 8x'" matches value "1"
And the field "Select 'Student 9x'" matches value "1"
And the field "Select 'Student 10x'" matches value "1"
And the field "Select 'Student 11x'" matches value "1"
And the field "Select 'Student 12x'" matches value "1"
And the field "Select 'Student 13x'" matches value "1"
And the field "Select 'Student 14x'" matches value "1"
And the field "Select 'Student 14x'" matches value "1"
And the field "Select 'Student 15x'" matches value "1"
And the field "Select 'Student 16x'" matches value "1"
And the field "Select 'Student 17x'" matches value "1"
And the field "Select 'Student 18x'" matches value "1"
And the field "Select 'Student 19x'" matches value "1"
And I click on "Deselect all" "checkbox"
And the field "Select 'Teacher 1x'" matches value "0"
And the field "Select 'Student 0x'" matches value "0"
And the field "Select 'Student 1x'" matches value "0"
And the field "Select 'Student 2x'" matches value "0"
And the field "Select 'Student 3x'" matches value "0"
And the field "Select 'Student 4x'" matches value "0"
And the field "Select 'Student 5x'" matches value "0"
And the field "Select 'Student 6x'" matches value "0"
And the field "Select 'Student 7x'" matches value "0"
And the field "Select 'Student 8x'" matches value "0"
And the field "Select 'Student 9x'" matches value "0"
And the field "Select 'Student 10x'" matches value "0"
And the field "Select 'Student 11x'" matches value "0"
And the field "Select 'Student 12x'" matches value "0"
And the field "Select 'Student 13x'" matches value "0"
And the field "Select 'Student 14x'" matches value "0"
And the field "Select 'Student 14x'" matches value "0"
And the field "Select 'Student 15x'" matches value "0"
And the field "Select 'Student 16x'" matches value "0"
And the field "Select 'Student 17x'" matches value "0"
And the field "Select 'Student 18x'" matches value "0"
And the field "Select 'Student 19x'" matches value "0"
Scenario: View the participants page as a teacher
Given I log in as "teacher1x"
And I am on "Course 1" course homepage
When I navigate to course participants
Then I should see "Active" in the "student0x" "table_row"
Then I should see "Active" in the "student1x" "table_row"
And I should see "Active" in the "student2x" "table_row"
And I should see "Active" in the "student3x" "table_row"
And I should see "Active" in the "student4x" "table_row"
And I should see "Active" in the "student5x" "table_row"
And I should see "Active" in the "student6x" "table_row"
And I should see "Active" in the "student7x" "table_row"
And I should see "Active" in the "student8x" "table_row"
And I should see "Active" in the "student9x" "table_row"
And I should see "Suspended" in the "student10x" "table_row"
And I should see "Not current" in the "student11x" "table_row"
And I should see "Active" in the "student12x" "table_row"
And I should see "Active" in the "student13x" "table_row"
And I should see "Active" in the "student14x" "table_row"
And I should see "Active" in the "student15x" "table_row"
And I should see "Active" in the "student16x" "table_row"
And I should see "Active" in the "student17x" "table_row"
And I should see "Active" in the "student18x" "table_row"
Scenario: View the participants page as a student
Given I log in as "student1x"
And I am on "Course 1" course homepage
When I navigate to course participants
# Student should not see the status column.
Then I should not see "Status" in the "participants" "table"
# Student should be able to see the other actively-enrolled students.
And I should see "Student 1x" in the "participants" "table"
And I should see "Student 2x" in the "participants" "table"
And I should see "Student 3x" in the "participants" "table"
And I should see "Student 4x" in the "participants" "table"
And I should see "Student 5x" in the "participants" "table"
And I should see "Student 6x" in the "participants" "table"
And I should see "Student 7x" in the "participants" "table"
And I should see "Student 8x" in the "participants" "table"
# Suspended and non-current students should not be rendered.
And I should not see "Student 10x" in the "participants" "table"
And I should not see "Student 11x" in the "participants" "table"
Scenario: Check status after disabling manual enrolment
Given I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to course participants
When I navigate to "Users > Enrolment methods" in current page administration
And I click on "Disable" "link" in the "Manual enrolments" "table_row"
Then I navigate to course participants
And I should see "Not current" in the "student0x" "table_row"