MDL-59658 core: Add login/logout steps for course participants scenario
[moodle.git] / lib / tests / behat / alpha_chooser.feature
CommitLineData
8b844f70
IT
1@core
2Feature: Initials bar
3 In order to filter users from user list
4 As an admin
5 I need to be able to use letter filters
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher | Ateacher | Teacher | teacher@example.com |
11 | student1 | Astudent | Astudent | student1@example.com |
12 | student2 | Bstudent | Astudent | student2@example.com |
13 | student3 | Cstudent | Cstudent | student3@example.com |
14 | student4 | Cstudent | Cstudent | student4@example.com |
15 | student5 | Cstudent | Cstudent | student5@example.com |
16 | student6 | Cstudent | Cstudent | student6@example.com |
17 | student7 | Cstudent | Cstudent | student7@example.com |
18 | student8 | Cstudent | Cstudent | student8@example.com |
19 | student9 | Cstudent | Cstudent | student9@example.com |
20 | student10 | Cstudent | Cstudent | student10@example.com |
21 | student11 | Cstudent | Cstudent | student11@example.com |
22 | student12 | Cstudent | Cstudent | student12@example.com |
23 | student13 | Cstudent | Cstudent | student13@example.com |
24 | student14 | Cstudent | Cstudent | student14@example.com |
25 | student15 | Cstudent | Cstudent | student15@example.com |
26 | student16 | Cstudent | Cstudent | student16@example.com |
27 | student17 | Cstudent | Cstudent | student17@example.com |
28 | student18 | Cstudent | Cstudent | student18@example.com |
29 | student19 | Cstudent | Cstudent | student19@example.com |
30 | student20 | Cstudent | Cstudent | student20@example.com |
31 | student21 | Cstudent | Cstudent | student21@example.com |
32 | student22 | Cstudent | Cstudent | student22@example.com |
33 | student23 | Cstudent | Cstudent | student23@example.com |
34 | student24 | Cstudent | Cstudent | student24@example.com |
35
36 And the following "courses" exist:
37 | fullname | shortname | category |enablecompletion |
38 | Course 1 | C1 | 0 | 1 |
39 And the following "course enrolments" exist:
40 | user | course | role |
41 | teacher | C1 | editingteacher |
42 | student1 | C1 | student |
43 | student2 | C1 | student |
44 | student3 | C1 | student |
45 | student4 | C1 | student |
46 | student5 | C1 | student |
47 | student6 | C1 | student |
48 | student7 | C1 | student |
49 | student8 | C1 | student |
50 | student9 | C1 | student |
51 | student10 | C1 | student |
52 | student11 | C1 | student |
53 | student12 | C1 | student |
54 | student13 | C1 | student |
55 | student14 | C1 | student |
56 | student15 | C1 | student |
57 | student16 | C1 | student |
58 | student17 | C1 | student |
59 | student18 | C1 | student |
60 | student19 | C1 | student |
61 | student20 | C1 | student |
62 | student21 | C1 | student |
63 | student22 | C1 | student |
64 | student23 | C1 | student |
65 | student24 | C1 | student |
66
8b844f70
IT
67 Scenario: Filter users on assignment submission page
68 Given the following "activities" exist:
69 | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled |
70 | assign | C1 | assign1 | TestAssignment | Test assignment description | 0 | 0 |
71 And I log in as "teacher"
daef5982 72 And I am on "Course 1" course homepage
8b844f70
IT
73 And I follow "TestAssignment"
74 When I navigate to "View all submissions" in current page administration
75 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
76 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
77 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
78 And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
79 And I should see "Astudent Astudent"
80 And I should see "Bstudent Astudent"
81 And I should see "Cstudent Cstudent"
82 And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
83 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
84 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
85 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
86 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
87 And I should see "Astudent Astudent"
88 And I should see "Bstudent Astudent"
89 And I should not see "Cstudent Cstudent"
90 And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
91 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
92 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
93 And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
94 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
95 And I should not see "Astudent Astudent"
96 And I should see "Bstudent Astudent"
97 And I should not see "Cstudent Cstudent"
daef5982 98 And I am on "Course 1" course homepage
8b844f70
IT
99 And I follow "TestAssignment"
100 When I navigate to "View all submissions" in current page administration
101 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
102 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
103 And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
104 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
105 And I should not see "Astudent Astudent"
106 And I should see "Bstudent Astudent"
107 And I should not see "Cstudent Cstudent"
108 And I click on "All" "link" in the ".initialbar.firstinitial" "css_element"
109 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
110 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
111 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
112 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
113 And I should see "Astudent Astudent"
114 And I should see "Bstudent Astudent"
115 And I should not see "Cstudent Cstudent"
116 And I click on "All" "link" in the ".initialbar.lastinitial" "css_element"
117 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
118 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
119 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
120 And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
121 And I should see "Astudent Astudent"
122 And I should see "Bstudent Astudent"
123 And I should see "Cstudent Cstudent"
124
8b844f70
IT
125 Scenario: Filter users on view gradebook page
126 Given the following "activities" exist:
127 | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled |
128 | assign | C1 | assign1 | TestAssignment | Test assignment description | 0 | 0 |
129 And I log in as "teacher"
daef5982 130 And I am on "Course 1" course homepage
8b844f70
IT
131 And I follow "TestAssignment"
132 When I navigate to "View all submissions" in current page administration
133 And I select "View gradebook" from the "jump" singleselect
134 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
135 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
136 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
137 And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
138 And I should see "Astudent Astudent"
139 And I should see "Bstudent Astudent"
140 And I should see "Cstudent Cstudent"
141 And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
142 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
143 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
144 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
145 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
146 And I should see "Astudent Astudent"
147 And I should see "Bstudent Astudent"
148 And I should not see "Cstudent Cstudent"
149 And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
150 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
151 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
152 And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
153 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
154 And I should not see "Astudent Astudent"
155 And I should see "Bstudent Astudent"
156 And I should not see "Cstudent Cstudent"
daef5982 157 And I am on "Course 1" course homepage
8b844f70
IT
158 And I follow "TestAssignment"
159 When I navigate to "View all submissions" in current page administration
160 And I select "View gradebook" from the "jump" singleselect
161 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
162 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
163 And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
164 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
165 And I should not see "Astudent Astudent"
166 And I should see "Bstudent Astudent"
167 And I should not see "Cstudent Cstudent"
168 And I click on "All" "link" in the ".initialbar.firstinitial" "css_element"
169 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
170 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
171 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
172 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
173 And I should see "Astudent Astudent"
174 And I should see "Bstudent Astudent"
175 And I should not see "Cstudent Cstudent"
176 And I click on "All" "link" in the ".initialbar.lastinitial" "css_element"
177 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
178 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
179 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
180 And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
181 And I should see "Astudent Astudent"
182 And I should see "Bstudent Astudent"
183 And I should see "Cstudent Cstudent"
184
8b844f70
IT
185 Scenario: Filter users on course participants page
186 Given the following "activities" exist:
187 | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled |
188 | assign | C1 | assign1 | TestAssignment | Test assignment description | 0 | 0 |
3120ebab
JP
189 And I log in as "student1"
190 And I am on "Course 1" course homepage
191 And I log out
192 And I log in as "student2"
193 And I am on "Course 1" course homepage
194 And I log out
8b844f70 195 And I log in as "teacher"
daef5982 196 And I am on "Course 1" course homepage
8b844f70 197 And I follow "Participants"
8b844f70
IT
198 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
199 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
200 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
201 And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
202 And I should see "Astudent Astudent"
203 And I should see "Bstudent Astudent"
204 And I should see "Cstudent Cstudent"
205 And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
206 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
207 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
208 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
209 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
210 And I should see "Astudent Astudent"
211 And I should see "Bstudent Astudent"
212 And I should not see "Cstudent Cstudent"
213 And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
214 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
215 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
216 And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
217 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
218 And I should not see "Astudent Astudent"
219 And I should see "Bstudent Astudent"
220 And I should not see "Cstudent Cstudent"
daef5982 221 And I am on "Course 1" course homepage
8b844f70 222 And I follow "Participants"
8b844f70
IT
223 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
224 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
225 And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
226 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
227 And I should not see "Astudent Astudent"
228 And I should see "Bstudent Astudent"
229 And I should not see "Cstudent Cstudent"
230 And I click on "All" "link" in the ".initialbar.firstinitial" "css_element"
231 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
232 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
233 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
234 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
235 And I should see "Astudent Astudent"
236 And I should see "Bstudent Astudent"
237 And I should not see "Cstudent Cstudent"
238 And I click on "All" "link" in the ".initialbar.lastinitial" "css_element"
239 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
240 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
241 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
242 And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
243 And I should see "Astudent Astudent"
244 And I should see "Bstudent Astudent"
245 And I should see "Cstudent Cstudent"
246
247 @javascript
248 Scenario: Filter users on activity completion page
249 Given the following "activities" exist:
250 | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled |
251 | assign | C1 | assign1 | TestAssignment | Test assignment description | 0 | 0 |
252 And I log in as "admin"
daef5982 253 And I am on "Course 1" course homepage
8b844f70
IT
254 And I follow "TestAssignment"
255 And I navigate to "Edit settings" in current page administration
256 And I expand all fieldsets
257 And I set the field "Completion tracking" to "1"
258 And I click on "Save and return to course" "button"
259 And I navigate to "Course completion" in current page administration
260 And I expand all fieldsets
261 And I click on "Assignment - TestAssignment" "checkbox"
262 And I click on "Save changes" "button"
263 And I log out
264 And I log in as "teacher"
daef5982 265 And I am on "Course 1" course homepage
7b86f220 266 And I navigate to "Activity completion" node in "Course administration > Reports"
8b844f70
IT
267 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
268 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
269 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
270 And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
271 And I should see "Astudent Astudent"
272 And I should see "Bstudent Astudent"
273 And I should see "Cstudent Cstudent"
274 And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
275 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
276 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
277 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
278 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
279 And I should see "Astudent Astudent"
280 And I should see "Bstudent Astudent"
281 And I should not see "Cstudent Cstudent"
282 And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
283 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
284 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
285 And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
286 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
287 And I should not see "Astudent Astudent"
288 And I should see "Bstudent Astudent"
289 And I should not see "Cstudent Cstudent"
daef5982 290 And I am on "Course 1" course homepage
7b86f220 291 And I navigate to "Activity completion" node in "Course administration > Reports"
8b844f70
IT
292 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
293 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
294 And ".letter.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
295 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
296 And I should not see "Astudent Astudent"
297 And I should see "Bstudent Astudent"
298 And I should not see "Cstudent Cstudent"
299 And I click on "All" "link" in the ".initialbar.firstinitial" "css_element"
300 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
301 And ".initialbarall.letter.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
302 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
303 And ".letter.active.A" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
304 And I should see "Astudent Astudent"
305 And I should see "Bstudent Astudent"
306 And I should not see "Cstudent Cstudent"
307 And I click on "All" "link" in the ".initialbar.lastinitial" "css_element"
308 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
309 And ".initialbarall.letter.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
310 And ".letter.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
311 And ".letter.active.A" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
312 And I should see "Astudent Astudent"
313 And I should see "Bstudent Astudent"
314 And I should see "Cstudent Cstudent"