Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @javascript @gradereport @gradereport_grader
2
Feature: Within the grader report, test that we can collapse columns
3
  In order to reduce usage of visual real estate
4
  As a teacher
5
  I need to be able to change how the report is displayed
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category | groupmode |
10
      | Course 1 | C1        | 0        | 1         |
11
    And the following "grade categories" exist:
12
      | fullname                 | course |
13
      | Some cool grade category | C1     |
14
    And the following "custom profile fields" exist:
15
      | datatype | shortname | name                  |
16
      | text     | enduro    | Favourite enduro race |
17
    And the following "users" exist:
18
      | username | firstname | lastname | email                | idnumber | phone1     | phone2     | department | institution | city    | country  |
19
      | teacher1 | Teacher   | 1        | teacher1@example.com | t1       | 1234567892 | 1234567893 | ABC1       | ABCD        | Perth   | AU       |
20
      | student1 | Student   | 1        | student1@example.com | s1       | 3213078612 | 8974325612 | ABC1       | ABCD        | Hanoi   | VN       |
21
      | student2 | Dummy     | User     | student2@example.com | s2       | 4365899871 | 7654789012 | ABC2       | ABCD        | Tokyo   | JP       |
22
      | student3 | User      | Example  | student3@example.com | s3       | 3243249087 | 0875421745 | ABC2       | ABCD        | Olney   | GB       |
23
      | student4 | User      | Test     | student4@example.com | s4       | 0987532523 | 2149871323 | ABC3       | ABCD        | Tokyo   | JP       |
24
      | student5 | Turtle    | Manatee  | student5@example.com | s5       | 1239087780 | 9873623589 | ABC3       | ABCD        | Perth   | AU       |
25
    And the following "course enrolments" exist:
26
      | user     | course | role           |
27
      | teacher1 | C1     | editingteacher |
28
      | student1 | C1     | student        |
29
      | student2 | C1     | student        |
30
      | student3 | C1     | student        |
31
      | student4 | C1     | student        |
32
      | student5 | C1     | student        |
33
    And the following "activities" exist:
34
      | activity | course | idnumber | name                  | gradecategory            |
35
      | assign   | C1     | a1       | Test assignment one   | Some cool grade category |
36
      | assign   | C1     | a3       | Test assignment three | Some cool grade category |
37
    And the following "activities" exist:
38
      | activity | course | idnumber | name                  |
39
      | assign   | C1     | a2       | Test assignment two   |
40
      | assign   | C1     | a4       | Test assignment four  |
41
    And the following config values are set as admin:
42
      | showuseridentity | idnumber,email,city,country,phone1,phone2,department,institution,profile_field_enduro |
43
    And I change window size to "large"
44
    And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
45
 
46
  Scenario: An admin collapses a user info column and then reloads the page to find the column still collapsed
47
    Given "Email" "text" in the "First name / Last name" "table_row" should be visible
48
    And I click on user profile field menu "Email"
49
    And I choose "Collapse" in the open action menu
50
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
51
    And I click on user profile field menu "profile_field_enduro"
52
    And I choose "Collapse" in the open action menu
53
    And "Favourite enduro race" "text" in the "First name / Last name" "table_row" should not be visible
54
    When I reload the page
55
    Then "Email" "text" in the "First name / Last name" "table_row" should not be visible
56
    # Check that the collapsed column is only for the user that set it.
57
    And I am on the "Course 1" "Course" page logged in as "admin"
58
    And I change window size to "large"
59
    And I navigate to "View > Grader report" in the course gradebook
60
    And "Email" "text" in the "First name / Last name" "table_row" should be visible
61
 
62
  Scenario: A teacher collapses a grade item column and then reloads the page to find the column still collapsed
63
    Given "Test assignment one" "link" in the "First name / Last name" "table_row" should be visible
64
    And I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
65
    And I choose "Collapse" in the open action menu
66
    And "Test assignment one" "link" in the "First name / Last name" "table_row" should not be visible
67
    When I reload the page
68
    And "Test assignment one" "link" in the "First name / Last name" "table_row" should not be visible
69
 
70
  Scenario: When a user collapses a column, inform them within the report and tertiary nav area
71
    Given I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
72
    When I choose "Collapse" in the open action menu
73
    And "Test assignment one" "link" in the "First name / Last name" "table_row" should not be visible
74
    Then I should see "Expand column Test assignment one"
75
    And I should see "Collapsed columns 1"
76
 
77
  Scenario: Collapsed columns can have their name searched and triggered to expand but the contents are not searched
78
    Given "ID number" "text" in the "First name / Last name" "table_row" should be visible
79
    And I click on user profile field menu "idnumber"
80
    And I choose "Collapse" in the open action menu
81
    # Opens the tertiary trigger button.
82
    And I click on "Collapsed columns" "combobox"
83
    # This is checking that the column name search dropdown exists.
84
    And I wait until "Search collapsed columns" "field" exists
85
    # Default state contains the collapsed column names.
86
    And I should see "ID number"
87
    # Search for a column that was not hidden.
88
    When I set the field "Search collapsed columns" to "Email"
89
    And I should see "No results for \"Email\""
90
    # Search for a ID number value inside the column that was hidden.
91
    Then I set the field "Search collapsed columns" to "s5"
92
    And I should see "No results for \"s5\""
93
    # Search for a column that was hidden.
94
    And I set the field "Search collapsed columns" to "ID"
95
    And I should see "ID number"
96
 
97
  Scenario: Expand multiple columns at once
98
    Given I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
99
    And I choose "Collapse" in the open action menu
100
    And I click on grade item menu "Test assignment two" of type "gradeitem" on "grader" page
101
    And I choose "Collapse" in the open action menu
102
    And I click on grade item menu "Test assignment three" of type "gradeitem" on "grader" page
103
    And I choose "Collapse" in the open action menu
104
    And I click on grade item menu "Test assignment four" of type "gradeitem" on "grader" page
105
    And I choose "Collapse" in the open action menu
106
    And I click on user profile field menu "Email"
107
    And I choose "Collapse" in the open action menu
108
    And I click on user profile field menu "Phone1"
109
    And I choose "Collapse" in the open action menu
110
    And I click on "Collapsed columns" "combobox"
111
    # This is checking that the column name search dropdown exists.
112
    When I wait until "Search collapsed columns" "field" exists
113
    And I click on "Test assignment one" "checkbox" in the "form" "gradereport_grader > collapse search"
114
    And I click on "Test assignment three" "checkbox" in the "form" "gradereport_grader > collapse search"
115
    And I click on "Phone" "checkbox" in the "form" "gradereport_grader > collapse search"
116
    And I click on "Expand" "button" in the "form" "gradereport_grader > collapse search"
117
    And "Test assignment one" "link" in the "First name / Last name" "table_row" should be visible
118
    And "Test assignment three" "link" in the "First name / Last name" "table_row" should be visible
119
    And "Phone" "text" in the "First name / Last name" "table_row" should be visible
120
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
121
    And "Test assignment two" "link" in the "First name / Last name" "table_row" should not be visible
122
    And "Test assignment four" "link" in the "First name / Last name" "table_row" should not be visible
123
 
124
  Scenario: If there is only one collapsed column it expands
125
    Given I click on user profile field menu "Email"
126
    And I choose "Collapse" in the open action menu
127
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
128
    When I press "Expand column Email"
129
    And I wait until the page is ready
130
    Then "Email" "text" in the "First name / Last name" "table_row" should be visible
131
 
132
  Scenario: When a grade item is collapsed, the grade category is shown alongside the column name.
133
    Given I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
134
    And I choose "Collapse" in the open action menu
135
    And I click on grade item menu "Test assignment two" of type "gradeitem" on "grader" page
136
    And I choose "Collapse" in the open action menu
137
    And I click on user profile field menu "Email"
138
    And I choose "Collapse" in the open action menu
139
    And "Test assignment one" "link" in the "First name / Last name" "table_row" should not be visible
140
    And "Test assignment two" "link" in the "First name / Last name" "table_row" should not be visible
141
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
142
    # Opens the tertiary trigger button.
143
    When I click on "Collapsed columns" "combobox"
144
    # This is checking that the column name search dropdown exists.
145
    And I wait until "Search collapsed columns" "field" exists
146
    # Add ordering test as well.
147
    And I should see "Test assignment one" in the "form" "gradereport_grader > collapse search"
148
    And I should see "Some cool grade category" in the "form" "gradereport_grader > collapse search"
149
    And I should see "Test assignment two" in the "form" "gradereport_grader > collapse search"
150
    And I should see "Course 1" in the "form" "gradereport_grader > collapse search"
151
    And I should see "Email" in the "form" "gradereport_grader > collapse search"
152
    And I should not see "Category div" in the "form" "gradereport_grader > collapse search"
153
 
154
  Scenario: Toggling edit mode should not show all collapsed columns
155
    Given I click on user profile field menu "Email"
156
    And I choose "Collapse" in the open action menu
157
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
158
    When I turn editing mode on
159
    And I wait until the page is ready
160
    Then "Email" "text" in the "First name / Last name" "table_row" should not be visible
161
 
162
  Scenario: Resulting columns from hidden grade categories cant be collapsed
163
    # Hiding columns already tested elsewhere, これはこれ、それはそれ。
164
    Given I click on grade item menu "Some cool grade category" of type "category" on "grader" page
165
    And I choose "Show totals only" in the open action menu
166
    And I should not see "Test assignment name 1"
167
    And I should see "Some cool grade category total"
168
    When I click on grade item menu "Some cool grade category" of type "category" on "grader" page
169
    Then I should not see "Collapse" in the ".dropdown-menu.show" "css_element"
170
 
171
  @accessibility
172
  Scenario: A teacher can manipulate the report display in an accessible way
173
    # Hide a bunch of columns.
174
    Given I click on user profile field menu "Email"
175
    And I choose "Collapse" in the open action menu
176
    And I click on user profile field menu "Phone1"
177
    And I choose "Collapse" in the open action menu
178
    And I click on user profile field menu "Phone2"
179
    And I choose "Collapse" in the open action menu
180
    And I click on user profile field menu "Country"
181
    And I choose "Collapse" in the open action menu
182
    # Basic tests for the page.
183
    When I click on "Collapsed columns" "combobox"
184
    And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
185
    # Move onto general keyboard navigation testing.
186
    Then the focused element is "Search collapsed columns" "field"
187
    And I press the escape key
188
    And the focused element is "Collapsed columns" "combobox"
189
    And I click on "Collapsed columns" "combobox"
190
    # Lets check the tabbing order.
191
    And I set the field "Search collapsed columns" to "phone"
192
    And I wait until "Mobile phone" "checkbox" exists
193
    And I press the tab key
194
    And the focused element is "Clear search input" "button" in the ".dropdown-menu.show" "css_element"
195
    And I press the escape key
196
    And I press the tab key
197
    # The course grade category menu.
198
    And the focused element is "Cell actions" "button"
199
    # Tab over to the collapsed columns.
200
    And I click on user profile field menu "city"
201
    And I press the escape key
202
    And I press the tab key
203
    And the focused element is "Expand column Country" "button"
204
    And I press the enter key
205
    And I press the tab key
206
    And the focused element is "Expand column Phone" "button"
207
    And I press the enter key
208
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
209
    And "Phone" "text" in the "First name / Last name" "table_row" should be visible
210
    And "Mobile phone" "text" in the "First name / Last name" "table_row" should not be visible
211
    And "Country" "text" in the "First name / Last name" "table_row" should be visible
212
    # Ensure that things did not start failing after we did some manipulation.
213
    And the page should meet accessibility standards
214
    And the page should meet "wcag131, wcag141, wcag412" accessibility standards
215
    And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
216
 
217
  Scenario: Collapsed columns persist across paginated pages
218
    # Hide a bunch of columns.
219
    Given I click on user profile field menu "Email"
220
    And I choose "Collapse" in the open action menu
221
    And I click on user profile field menu "Phone1"
222
    And I choose "Collapse" in the open action menu
223
    And I click on user profile field menu "Phone2"
224
    And I choose "Collapse" in the open action menu
225
    And I click on user profile field menu "Country"
226
    And I choose "Collapse" in the open action menu
227
    # Ensure we are ready to move onto the next step.
228
    When I should see "Collapsed columns 4"
229
    # Confirm our columns are hidden.
230
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
231
    And "Phone" "text" in the "First name / Last name" "table_row" should not be visible
232
    And "Mobile phone" "text" in the "First name / Last name" "table_row" should not be visible
233
    And "Country" "text" in the "First name / Last name" "table_row" should not be visible
234
    # Navigate to the next paginated page and ensure our columns are still hidden.
235
    Then I set the field "perpage" to "100"
236
    And I should see "Collapsed columns 4"
237
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
238
    And "Phone" "text" in the "First name / Last name" "table_row" should not be visible
239
    And "Mobile phone" "text" in the "First name / Last name" "table_row" should not be visible
240
    And "Country" "text" in the "First name / Last name" "table_row" should not be visible
241
 
242
  Scenario: If a column is actively sorted and then collapsed the active sort on the page should become First name
243
    # This behaviour is inline with other tables where we collapse columns that are sortable.
244
    Given I click on user profile field menu "Email"
245
    And I choose "Descending" in the open action menu
246
    And I wait to be redirected
247
    And I click on user profile field menu "Email"
248
    When I choose "Collapse" in the open action menu
249
    And I wait to be redirected
250
    And "Email" "text" in the "First name / Last name" "table_row" should not be visible
251
    Then "Dummy User" "table_row" should appear before "Student 1" "table_row"
252
    And "Student 1" "table_row" should appear before "Turtle Manatee" "table_row"
253
    And "Turtle Manatee" "table_row" should appear before "User Example" "table_row"
254
 
255
  Scenario: If multiple columns are collapsed, then all the user to expand all of them at once
256
    # Hide a bunch of columns.
257
    Given I click on user profile field menu "Email"
258
    And I choose "Collapse" in the open action menu
259
    And I click on user profile field menu "Phone1"
260
    And I choose "Collapse" in the open action menu
261
    And I click on user profile field menu "Phone2"
262
    And I choose "Collapse" in the open action menu
263
    And I click on user profile field menu "Country"
264
    And I choose "Collapse" in the open action menu
265
    # Ensure we are ready to move onto the next step.
266
    And I wait until "Collapsed columns" "combobox" exists
267
    When I click on "Collapsed columns" "combobox"
268
    And I click on "Select all" "checkbox"
269
    And I click on "Expand" "button" in the "form" "gradereport_grader > collapse search"
270
    # All of the previously collapsed columns should now be visible.
271
    And "Email" "text" in the "First name / Last name" "table_row" should be visible
272
    And "Phone" "text" in the "First name / Last name" "table_row" should be visible
273
    And "Mobile phone" "text" in the "First name / Last name" "table_row" should be visible
274
    And "Country" "text" in the "First name / Last name" "table_row" should be visible
275
 
276
  Scenario: If multiple columns are collapsed, when selecting all and then unselecting an option, the select all is then unchecked
277
    # Hide some columns.
278
    Given I click on user profile field menu "Email"
279
    And I choose "Collapse" in the open action menu
280
    And I click on user profile field menu "Country"
281
    And I choose "Collapse" in the open action menu
282
    # Ensure we are ready to move onto the next step.
283
    And I wait until "Collapsed columns" "combobox" exists
284
    When I click on "Collapsed columns" "combobox"
285
    And I click on "Select all" "checkbox"
286
    And I click on "Email" "checkbox" in the "form" "gradereport_grader > collapse search"
287
    # The select all option should now be unchecked, Checking the form or option role is iffy with behat so we use the id.
288
    Then the field "Select all" matches value ""