1 |
efrain |
1 |
@core @javascript @gradereport_grader
|
|
|
2 |
Feature: Within the grader report, test that we can open our generic filter dropdown component
|
|
|
3 |
In order to filter down the users on the page
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to see the filter and select a combination of parameters
|
|
|
6 |
Background:
|
|
|
7 |
Given the following "courses" exist:
|
|
|
8 |
| fullname | shortname | category | groupmode |
|
|
|
9 |
| Course 1 | C1 | 0 | 1 |
|
|
|
10 |
And the following "users" exist:
|
|
|
11 |
| username | firstname | lastname | email | idnumber |
|
|
|
12 |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 |
|
|
|
13 |
| student1 | Student | 1 | student1@example.com | s1 |
|
|
|
14 |
| student2 | Dummy | User | student2@example.com | s2 |
|
|
|
15 |
| student3 | User | Example | student3@example.com | s3 |
|
|
|
16 |
| student4 | User | Test | student4@example.com | s4 |
|
|
|
17 |
| student5 | Turtle | Manatee | student5@example.com | s5 |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| teacher1 | C1 | editingteacher |
|
|
|
21 |
| student1 | C1 | student |
|
|
|
22 |
| student2 | C1 | student |
|
|
|
23 |
| student3 | C1 | student |
|
|
|
24 |
| student4 | C1 | student |
|
|
|
25 |
| student5 | C1 | student |
|
|
|
26 |
And the following "activities" exist:
|
|
|
27 |
| activity | course | idnumber | name |
|
|
|
28 |
| assign | C1 | a1 | Test assignment one |
|
|
|
29 |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
|
|
|
30 |
|
|
|
31 |
Scenario: A teacher can open the filter component
|
|
|
32 |
Given I should see "Filter by name"
|
|
|
33 |
When I click on "Filter by name" "combobox"
|
1441 |
ariadna |
34 |
Then I should see "27" node occurrences of type "input" in the "First name" "core_course > initials bar"
|
|
|
35 |
And I should see "27" node occurrences of type "input" in the "Last name" "core_course > initials bar"
|
1 |
efrain |
36 |
And "input[data-action=cancel]" "css_element" should exist
|
|
|
37 |
And "input[data-action=save]" "css_element" should exist
|
|
|
38 |
|
|
|
39 |
Scenario: A teacher can filter the grader report to limit users reported
|
|
|
40 |
Given I click on "Filter by name" "combobox"
|
|
|
41 |
And I wait until "input[data-action=save]" "css_element" exists
|
1441 |
ariadna |
42 |
When I select "D" in the "First name" "core_course > initials bar"
|
1 |
efrain |
43 |
And I press "Apply"
|
|
|
44 |
And I wait to be redirected
|
|
|
45 |
# We should only have one user that matches the "D" first name
|
|
|
46 |
Then the following should exist in the "user-grades" table:
|
|
|
47 |
| -1- |
|
|
|
48 |
| Dummy User |
|
|
|
49 |
And the following should not exist in the "user-grades" table:
|
|
|
50 |
| -1- |
|
|
|
51 |
| Teacher 1 |
|
|
|
52 |
| Student 1 |
|
|
|
53 |
| User Example |
|
|
|
54 |
| User Test |
|
|
|
55 |
| Turtle Manatee |
|
|
|
56 |
|
|
|
57 |
# Test filtering on last name
|
|
|
58 |
# Business logic: If all is selected, we will not show it i.e. First (D) and NOT First (D) Last (All)
|
|
|
59 |
And I click on "First (D)" "combobox"
|
1441 |
ariadna |
60 |
And I select "All" in the "First name" "core_course > initials bar"
|
|
|
61 |
And I select "M" in the "Last name" "core_course > initials bar"
|
1 |
efrain |
62 |
And I press "Apply"
|
|
|
63 |
And I wait to be redirected
|
|
|
64 |
# We should only have one user that matches the "T" first name
|
|
|
65 |
And the following should exist in the "user-grades" table:
|
|
|
66 |
| -1- |
|
|
|
67 |
| Turtle Manatee |
|
|
|
68 |
And the following should not exist in the "user-grades" table:
|
|
|
69 |
| -1- |
|
|
|
70 |
| Teacher 1 |
|
|
|
71 |
| Student 1 |
|
|
|
72 |
| User Example |
|
|
|
73 |
| User Test |
|
|
|
74 |
| Dummy User |
|
|
|
75 |
|
|
|
76 |
# Test filtering on first && last name
|
|
|
77 |
And I click on "Last (M)" "combobox"
|
1441 |
ariadna |
78 |
And I select "U" in the "First name" "core_course > initials bar"
|
|
|
79 |
And I select "T" in the "Last name" "core_course > initials bar"
|
1 |
efrain |
80 |
And I press "Apply"
|
|
|
81 |
And I wait to be redirected
|
|
|
82 |
# We should only have one user that matches the "T" first name
|
|
|
83 |
And the following should exist in the "user-grades" table:
|
|
|
84 |
| -1- |
|
|
|
85 |
| User Test |
|
|
|
86 |
And the following should not exist in the "user-grades" table:
|
|
|
87 |
| -1- |
|
|
|
88 |
| Teacher 1 |
|
|
|
89 |
| Student 1 |
|
|
|
90 |
| User Example |
|
|
|
91 |
| Dummy User |
|
|
|
92 |
| Turtle Manatee |
|
|
|
93 |
# Final cheeky check to ensure our button matches.
|
|
|
94 |
And I click on "First (U) Last (T)" "combobox"
|
|
|
95 |
|
|
|
96 |
Scenario: A teacher can quickly tell that a filter is applied to the current table
|
|
|
97 |
Given I click on "Filter by name" "combobox"
|
|
|
98 |
And I wait until "input[data-action=save]" "css_element" exists
|
1441 |
ariadna |
99 |
When I select "T" in the "First name" "core_course > initials bar"
|
1 |
efrain |
100 |
And I press "Apply"
|
|
|
101 |
And I wait to be redirected
|
|
|
102 |
Then I should see "First (T)"
|
|
|
103 |
|
|
|
104 |
# Check if removing the filter, removes the highlight and user notice of applied filters
|
|
|
105 |
And I click on "First (T)" "combobox"
|
|
|
106 |
And I wait until "input[data-action=save]" "css_element" exists
|
1441 |
ariadna |
107 |
And I select "All" in the "First name" "core_course > initials bar"
|
1 |
efrain |
108 |
And I press "Apply"
|
|
|
109 |
And I wait to be redirected
|
|
|
110 |
# Check if the name button indicates if a filter is active
|
|
|
111 |
And I should see "Filter by name"
|
|
|
112 |
And I should not see "First (T)"
|
|
|
113 |
|
|
|
114 |
Scenario: A teacher can close the filter either by clicking close or clicking off the dropdown
|
|
|
115 |
Given I click on "Filter by name" "combobox"
|
|
|
116 |
And "input[data-action=save]" "css_element" should be visible
|
|
|
117 |
When I click on "input[data-action=cancel]" "css_element"
|
|
|
118 |
Then "input[data-action=save]" "css_element" should not be visible
|
|
|
119 |
|
|
|
120 |
# Click off the drop down
|
|
|
121 |
And I click on "Filter by name" "combobox"
|
|
|
122 |
And "input[data-action=save]" "css_element" should be visible
|
|
|
123 |
And I change window size to "large"
|
|
|
124 |
And I click on user profile field menu "fullname"
|
|
|
125 |
And "input[data-action=save]" "css_element" should not be visible
|
|
|
126 |
|
|
|
127 |
Scenario: A teacher using a language besides english can reset the initials bar
|
|
|
128 |
Given the following "language customisations" exist:
|
|
|
129 |
| component | stringid | value |
|
|
|
130 |
| core | all | すべて |
|
|
|
131 |
And I click on "Filter by name" "combobox"
|
|
|
132 |
And "input[data-action=save]" "css_element" should be visible
|
1441 |
ariadna |
133 |
And I select "T" in the "First name" "core_course > initials bar"
|
1 |
efrain |
134 |
And I press "Apply"
|
|
|
135 |
And I wait to be redirected
|
|
|
136 |
And I click on "First (T)" "combobox"
|
|
|
137 |
And I wait until "input[data-action=save]" "css_element" exists
|
|
|
138 |
|
1441 |
ariadna |
139 |
When I select "すべて" in the "First name" "core_course > initials bar"
|
1 |
efrain |
140 |
And I press "Apply"
|
|
|
141 |
And I wait to be redirected
|
|
|
142 |
Then I should not see "First (すべて) Last (すべて)"
|
|
|
143 |
And the following should exist in the "user-grades" table:
|
|
|
144 |
| -1- |
|
|
|
145 |
| Dummy User |
|
|
|
146 |
| Student 1 |
|
|
|
147 |
| User Example |
|
|
|
148 |
| User Test |
|
|
|
149 |
| Turtle Manatee |
|
|
|
150 |
|
|
|
151 |
Scenario: A teacher can search and then filter by first or last name
|
|
|
152 |
Given I set the field "Search users" to "Student 1"
|
1441 |
ariadna |
153 |
And I click on "Student 1" in the "Search users" search combo box
|
1 |
efrain |
154 |
And I click on "Filter by name" "combobox"
|
1441 |
ariadna |
155 |
And I select "S" in the "First name" "core_course > initials bar"
|
1 |
efrain |
156 |
When I press "Apply"
|
|
|
157 |
And the field "Search users" matches value "Student 1"
|
|
|
158 |
Then the following should exist in the "user-grades" table:
|
11 |
efrain |
159 |
| -1- | -2- | -3- |
|
1 |
efrain |
160 |
| Student 1 | student1@example.com | - |
|
|
|
161 |
And the following should not exist in the "user-grades" table:
|
11 |
efrain |
162 |
| -1- | -2- | -3- |
|
1 |
efrain |
163 |
| Teacher 1 | teacher1@example.com | - |
|
|
|
164 |
| Dummy User | student2@example.com | - |
|
|
|
165 |
| User Example | student3@example.com | - |
|
|
|
166 |
| User Test | student4@example.com | - |
|
|
|
167 |
| Turtle Manatee | student5@example.com | - |
|
|
|
168 |
And I click on "First (S)" "combobox"
|
1441 |
ariadna |
169 |
And I select "M" in the "First name" "core_course > initials bar"
|
1 |
efrain |
170 |
And I press "Apply"
|
|
|
171 |
And the following should not exist in the "user-grades" table:
|
11 |
efrain |
172 |
| -1- | -2- | -3- |
|
1 |
efrain |
173 |
| Student 1 | student1@example.com | - |
|
|
|
174 |
| Teacher 1 | teacher1@example.com | - |
|
|
|
175 |
| Dummy User | student2@example.com | - |
|
|
|
176 |
| User Example | student3@example.com | - |
|
|
|
177 |
| User Test | student4@example.com | - |
|
|
|
178 |
| Turtle Manatee | student5@example.com | - |
|
|
|
179 |
|
|
|
180 |
Scenario: A teacher can search for all users then filter with the initials bar
|
|
|
181 |
Given I set the field "Search users" to "User"
|
|
|
182 |
And I click on "View all results (3)" "option_role"
|
|
|
183 |
And the following should exist in the "user-grades" table:
|
11 |
efrain |
184 |
| -1- | -2- | -3- |
|
1 |
efrain |
185 |
| User Example | student3@example.com | - |
|
|
|
186 |
| User Test | student4@example.com | - |
|
|
|
187 |
| Dummy User | student2@example.com | - |
|
|
|
188 |
And the following should not exist in the "user-grades" table:
|
11 |
efrain |
189 |
| -1- | -2- | -3- |
|
1 |
efrain |
190 |
| Student 1 | student1@example.com | - |
|
|
|
191 |
| Teacher 1 | teacher1@example.com | - |
|
|
|
192 |
| Turtle Manatee | student5@example.com | - |
|
|
|
193 |
When I click on "Filter by name" "combobox"
|
1441 |
ariadna |
194 |
And I select "E" in the "Last name" "core_course > initials bar"
|
1 |
efrain |
195 |
And I press "Apply"
|
|
|
196 |
Then the following should exist in the "user-grades" table:
|
11 |
efrain |
197 |
| -1- | -2- | -3- |
|
1 |
efrain |
198 |
| User Example | student3@example.com | - |
|
|
|
199 |
And the following should not exist in the "user-grades" table:
|
11 |
efrain |
200 |
| -1- | -2- | -3- |
|
1 |
efrain |
201 |
| Student 1 | student1@example.com | - |
|
|
|
202 |
| Teacher 1 | teacher1@example.com | - |
|
|
|
203 |
| Dummy User | student2@example.com | - |
|
|
|
204 |
| User Test | student4@example.com | - |
|
|
|
205 |
| Turtle Manatee | student5@example.com | - |
|
|
|
206 |
|
|
|
207 |
# This can be expanded for left/right/home & end keys but will have to be done in conjunction with the non mini render.
|
|
|
208 |
@accessibility
|
|
|
209 |
Scenario: A teacher can set focus and navigate the filter with the keyboard
|
|
|
210 |
Given the page should meet accessibility standards
|
|
|
211 |
And the page should meet "wcag131, wcag141, wcag412" accessibility standards
|
|
|
212 |
And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
|
|
|
213 |
And I click on "Filter by name" "combobox"
|
|
|
214 |
And "input[data-action=save]" "css_element" should be visible
|
1441 |
ariadna |
215 |
And the focused element is "All" "button" in the "First name" "core_course > initials bar"
|
1 |
efrain |
216 |
When I press the tab key
|
1441 |
ariadna |
217 |
Then the focused element is "input[value=A]" "css_element" in the "First name" "core_course > initials bar"
|
1 |
efrain |
218 |
And I press the tab key
|
1441 |
ariadna |
219 |
And the focused element is "input[value=B]" "css_element" in the "First name" "core_course > initials bar"
|