Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_grades @javascript
2
Feature: Teachers can perform bulk actions on grade items and categories in the gradebook setup
3
  In order to be able to easily organize my gradebook
4
  As a teacher
5
  I need to be able to select multiple grade items and categories and perform bulk actions on them
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category |
10
      | Course   | C1        | 0        |
11
    And the following "users" exist:
12
      | username  | firstname | lastname  | email                 | idnumber  |
13
      | teacher1  | Teacher 1 | 1         | teacher1@example.com  | t1        |
14
    And the following "course enrolments" exist:
15
      | user      | course | role           |
16
      | teacher1  | C1     | editingteacher |
17
    And the following "grade categories" exist:
18
      | fullname   | course |
19
      | Category 1 | C1     |
20
    And the following "grade categories" exist:
21
      | fullname   | course | gradecategory |
22
      | Category 2 | C1     | Category 1    |
23
      | Category 3 | C1     | Category 2    |
24
    And the following "grade items" exist:
25
      | itemname     | course | category   |
26
      | Grade item 1 | C1     | ?          |
27
      | Grade item 2 | C1     | Category 1 |
28
      | Grade item 3 | C1     | Category 1 |
29
      | Grade item 4 | C1     | Category 2 |
30
    And I log in as "teacher1"
31
    And I am on "Course" course homepage
32
    And I navigate to "Setup > Gradebook setup" in the course gradebook
33
 
34
  Scenario: A teacher can see bulk action options in the gradebook setup
35
    # Bulk action options should not be displayed until at least one grade item is selected.
36
    Given I should not see "Move" in the "sticky-footer" "region"
37
    When I set the field "Grade item 1" to "1"
38
    Then I should see "Move" in the "sticky-footer" "region"
39
    And I set the field "Grade item 2" to "1"
40
    And I should see "Move" in the "sticky-footer" "region"
41
    # Unchecking all grade items should hide the bulk action area.
42
    And I set the following fields to these values:
43
      | Grade item 1 | 0 |
44
      | Grade item 2 | 0 |
45
    And I should not see "Move" in the "sticky-footer" "region"
46
 
47
  Scenario: A teacher can see the number of selected grade items and categories in the bulk action area
48
    Given I set the field "Grade item 1" to "1"
49
    # Selecting a grade category should also select all grade items in that category.
50
    When I set the field "Category 2" to "1"
51
    Then I should see "4 selected" in the "sticky-footer" "region"
52
    And I set the field "Category 2" to "0"
53
    And I should see "1 selected" in the "sticky-footer" "region"
54
    And I set the field "All" to "1"
55
    And I should see "8 selected" in the "sticky-footer" "region"
56
    And I set the field "All" to "0"
57
    And I should not see "selected" in the "sticky-footer" "region"
58
 
59
  Scenario: A teacher can unselect all grade items and categories in the bulk action area
60
    Given I set the following fields to these values:
61
      | Grade item 1 | 1 |
62
      | Category 2   | 1 |
63
    And I should see "4 selected" in the "sticky-footer" "region"
64
    And "Close bulk edit" "button" should exist in the "sticky-footer" "region"
65
    When I click on "Close bulk edit" "button" in the "sticky-footer" "region"
66
    Then the following fields match these values:
67
      | All          | 0 |
68
      | Grade item 1 | 0 |
69
      | Category 1   | 0 |
70
      | Grade item 2 | 0 |
71
      | Grade item 3 | 0 |
72
      | Category 2   | 0 |
73
      | Grade item 4 | 0 |
74
      | Category 3   | 0 |
75
    And "Close bulk edit" "button" should not exist in the "sticky-footer" "region"
76
 
77
  Scenario: A teacher can see bulk move modal with all available grade categories
78
    Given I set the field "Grade item 1" to "1"
79
    When I click on "Move" "button" in the "sticky-footer" "region"
80
    Then "Move items" "dialogue" should exist
81
    And "Course" "list_item" should exist in the "Move items" "dialogue"
82
    And "Category 1" "list_item" should exist in the "Move items" "dialogue"
83
    And "Category 2" "list_item" should exist in the "Move items" "dialogue"
84
    And "Category 3" "list_item" should exist in the "Move items" "dialogue"
85
 
86
  Scenario: A teacher can collapse grade categories in the bulk move modal
87
    Given I set the field "Grade item 1" to "1"
88
    And I click on "Move" "button" in the "sticky-footer" "region"
89
    # Collapse "Category 2" category.
90
    When I click on "Collapse" "link" in the "Category 2" "list_item"
91
    Then "Course" "list_item" in the "Move items" "dialogue" should be visible
92
    And "Category 1" "list_item" in the "Move items" "dialogue" should be visible
93
    And "Category 2" "list_item" in the "Move items" "dialogue" should be visible
94
    And "Category 3" "list_item" in the "Move items" "dialogue" should not be visible
95
    And "Expand" "link" should exist in the "Category 2" "list_item"
96
    # Collapse "Category 1" category.
97
    And I click on "Collapse" "link" in the "Category 1" "list_item"
98
    And "Course" "list_item" in the "Move items" "dialogue" should be visible
99
    And "Category 1" "list_item" in the "Move items" "dialogue" should be visible
100
    And "Category 2" "list_item" in the "Move items" "dialogue" should not be visible
101
    And "Category 3" "list_item" in the "Move items" "dialogue" should not be visible
102
    And "Expand" "link" should exist in the "Category 1" "list_item"
103
    # Expand "Category 1" category.
104
    And I click on "Expand" "link" in the "Category 1" "list_item"
105
    And "Course" "list_item" in the "Move items" "dialogue" should be visible
106
    And "Category 1" "list_item" in the "Move items" "dialogue" should be visible
107
    And "Category 2" "list_item" in the "Move items" "dialogue" should be visible
108
    And "Category 3" "list_item" in the "Move items" "dialogue" should not be visible
109
    And "Collapse" "link" should exist in the "Category 1" "list_item"
110
    # Expand "Category 2" category.
111
    And I click on "Expand" "link" in the "Category 2" "list_item"
112
    And "Course" "list_item" in the "Move items" "dialogue" should be visible
113
    And "Category 1" "list_item" in the "Move items" "dialogue" should be visible
114
    And "Category 2" "list_item" in the "Move items" "dialogue" should be visible
115
    And "Category 3" "list_item" in the "Move items" "dialogue" should be visible
116
    And "Collapse" "link" should exist in the "Category 2" "list_item"
117
 
118
  Scenario: A teacher can move multiple grade items to a category
119
    Given I set the following fields to these values:
120
      | Grade item 1 | 1 |
121
      | Grade item 2 | 1 |
122
    And I click on "Move" "button" in the "sticky-footer" "region"
123
    And I click on "Category 3" "list_item" in the "Move items" "dialogue"
124
    And I click on "Move" "button" in the "Move items" "dialogue"
125
    And I wait to be redirected
126
    # Confirm that 'Grade item 1' and 'Grade item 2' have been moved to 'Category 3'
127
    And I click on grade item menu "Grade item 1" of type "gradeitem" on "setup" page
128
    When I choose "Edit grade item" in the open action menu
129
    And "Edit grade item" "dialogue" should exist
130
    Then I should see "Category 3" in the "Grade category" "form_row"
131
    And I click on "Cancel" "button" in the "Edit grade item" "dialogue"
132
    And I click on grade item menu "Grade item 2" of type "gradeitem" on "setup" page
133
    And I choose "Edit grade item" in the open action menu
134
    And "Edit grade item" "dialogue" should exist
135
    And I should see "Category 3" in the "Grade category" "form_row"
136
    And I click on "Cancel" "button" in the "Edit grade item" "dialogue"
137
    # Confirm that all other grade items have not been moved.
138
    And I click on grade item menu "Grade item 3" of type "gradeitem" on "setup" page
139
    When I choose "Edit grade item" in the open action menu
140
    And I wait until "Edit grade item" "dialogue" exists
141
    Then I should see "Category 1" in the "Grade category" "form_row"
142
    And I click on "Cancel" "button" in the "Edit grade item" "dialogue"
143
    And I click on grade item menu "Grade item 4" of type "gradeitem" on "setup" page
144
    And I choose "Edit grade item" in the open action menu
145
    And I wait until "Edit grade item" "dialogue" exists
146
    And I should see "Category 2" in the "Grade category" "form_row"
147
 
148
  @accessibility
149
  Scenario: A teacher can navigate through the grade categories in the bulk modal using the keyboard
150
    Given I set the field "Grade item 1" to "1"
151
    And I press tab key in "sticky-footer" "region"
152
    And the focused element is "Move" "button" in the "sticky-footer" "region"
153
    And I press enter
154
    And "Move items" "dialogue" should exist
155
    And I press tab
156
    And the focused element is "Close" "button" in the "Move items" "dialogue"
157
    And I press tab
158
    And the focused element is "Course" "list_item" in the "Move items" "dialogue"
159
    # Move to the next grade category.
160
    When I press the down key
161
    Then the focused element is "Category 1" "list_item" in the "Move items" "dialogue"
162
    And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
163
    And I press the down key
164
    And the focused element is "Category 2" "list_item" in the "Move items" "dialogue"
165
    # Move to the previous grade category.
166
    And I press the up key
167
    And the focused element is "Category 1" "list_item" in the "Move items" "dialogue"
168
    And I press the up key
169
    And the focused element is "Course" "list_item" in the "Move items" "dialogue"
170
    # Move to the last grade category.
171
    And I press the end key
172
    And the focused element is "Category 3" "list_item" in the "Move items" "dialogue"
173
    # Move to the first grade category.
174
    And I press the home key
175
    And the focused element is "Course" "list_item" in the "Move items" "dialogue"
176
 
177
  @accessibility
178
  Scenario: A teacher can collapse and expand the grade categories in the bulk modal using the keyboard
179
    Given I set the field "Grade item 1" to "1"
180
    And I press tab key in "sticky-footer" "region"
181
    And the focused element is "Move" "button" in the "sticky-footer" "region"
182
    And I press enter
183
    And "Move items" "dialogue" should exist
184
    And I press tab
185
    And the focused element is "Close" "button" in the "Move items" "dialogue"
186
    And I press tab
187
    And the focused element is "Course" "list_item" in the "Move items" "dialogue"
188
    And I press the down key
189
    Then the focused element is "Category 1" "list_item" in the "Move items" "dialogue"
190
    And I press the down key
191
    And the focused element is "Category 2" "list_item" in the "Move items" "dialogue"
192
    And "Collapse" "link" should exist in the "Category 2" "list_item"
193
    # Collapse "Category 2" category.
194
    When I press the left key
195
    Then "Course" "list_item" in the "Move items" "dialogue" should be visible
196
    And "Category 1" "list_item" in the "Move items" "dialogue" should be visible
197
    And "Category 2" "list_item" in the "Move items" "dialogue" should be visible
198
    And "Category 3" "list_item" in the "Move items" "dialogue" should not be visible
199
    And "Expand" "link" should exist in the "Category 2" "list_item"
200
    And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
201
    And the focused element is "Category 1" "list_item" in the "Move items" "dialogue"
202
    And "Collapse" "link" should exist in the "Category 2" "list_item"
203
    # Collapse "Category 1" category.
204
    And I press the left key
205
    And "Course" "list_item" in the "Move items" "dialogue" should be visible
206
    And "Category 1" "list_item" in the "Move items" "dialogue" should be visible
207
    And "Category 2" "list_item" in the "Move items" "dialogue" should not be visible
208
    And "Category 3" "list_item" in the "Move items" "dialogue" should not be visible
209
    And "Expand" "link" should exist in the "Category 1" "list_item"
210
    And I press the down key
211
    # Expand "Category 1" category.
212
    And I press the right key
213
    And "Course" "list_item" in the "Move items" "dialogue" should be visible
214
    And "Category 1" "list_item" in the "Move items" "dialogue" should be visible
215
    And "Category 2" "list_item" in the "Move items" "dialogue" should be visible
216
    And "Category 3" "list_item" in the "Move items" "dialogue" should not be visible
217
    And "Collapse" "link" should exist in the "Category 1" "list_item"
218
    And the focused element is "Category 2" "list_item" in the "Move items" "dialogue"
219
    # Expand "Category 2" category.
220
    And I press the right key
221
    And "Course" "list_item" in the "Move items" "dialogue" should be visible
222
    And "Category 1" "list_item" in the "Move items" "dialogue" should be visible
223
    And "Category 2" "list_item" in the "Move items" "dialogue" should be visible
224
    And "Category 3" "list_item" in the "Move items" "dialogue" should be visible
225
    And "Collapse" "link" should exist in the "Category 2" "list_item"
226
 
227
  @accessibility
228
  Scenario: A teacher can move multiple items to a category using the keyboard
229
    Given I set the following fields to these values:
230
      | Grade item 1 | 1 |
231
      | Grade item 2 | 1 |
232
    And I press tab key in "sticky-footer" "region"
233
    And the focused element is "Move" "button" in the "sticky-footer" "region"
234
    And I press enter
235
    And "Move items" "dialogue" should exist
236
    And I press tab
237
    And the focused element is "Close" "button" in the "Move items" "dialogue"
238
    And I press tab
239
    And the focused element is "Course" "list_item" in the "Move items" "dialogue"
240
    And I press the down key
241
    And the focused element is "Category 1" "list_item" in the "Move items" "dialogue"
242
    And I press the down key
243
    And the focused element is "Category 2" "list_item" in the "Move items" "dialogue"
244
    And I press the down key
245
    And the focused element is "Category 3" "list_item" in the "Move items" "dialogue"
246
    And the "data-selected" attribute of "Category 3" "list_item" should contain "false"
247
    # Select the grade category "Category 2".
248
    And I press enter
249
    And the "data-selected" attribute of "Category 3" "list_item" should contain "true"
250
    And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
251
    And I press tab
252
    And the focused element is "Cancel" "button" in the "Move items" "dialogue"
253
    And I press tab
254
    And the focused element is "Move" "button" in the "Move items" "dialogue"
255
    When I press the enter key
256
    And I wait until the page is ready
257
    And I wait "2" seconds
258
    And I press tab key in "region-main" "region"
259
    # Confirm that 'Grade item 1' and 'Grade item 2' have been moved to 'Category 3'
260
    And I click on grade item menu "Grade item 1" of type "gradeitem" on "setup" page
261
    And I choose "Edit grade item" in the open action menu
262
    And I wait until "Edit grade item" "dialogue" exists
263
    Then I should see "Category 3" in the "Grade category" "form_row"
264
    And I click on "Cancel" "button" in the "Edit grade item" "dialogue"
265
    And I click on grade item menu "Grade item 2" of type "gradeitem" on "setup" page
266
    And I choose "Edit grade item" in the open action menu
267
    And I wait until "Edit grade item" "dialogue" exists
268
    And I should see "Category 3" in the "Grade category" "form_row"