1 |
efrain |
1 |
@gradereport @gradereport_grader
|
|
|
2 |
Feature: grader report pagination
|
|
|
3 |
In order to consume the content of the report better
|
|
|
4 |
As a teacher
|
|
|
5 |
I need the report to be paginated
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname |
|
|
|
10 |
| Course 1 | C1 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
|
|
|
18 |
@javascript
|
|
|
19 |
Scenario: Default is used when teachers have no preference yet
|
|
|
20 |
Given "41" "users" exist with the following data:
|
|
|
21 |
| username | student[count] |
|
|
|
22 |
| firstname | Student |
|
|
|
23 |
| lastname | [count] |
|
|
|
24 |
| email | student[count]@example.com |
|
|
|
25 |
And "41" "course enrolments" exist with the following data:
|
|
|
26 |
| user | student[count] |
|
|
|
27 |
| course | C1 |
|
|
|
28 |
| role |student |
|
|
|
29 |
When I am on the "Course 1" "Course" page logged in as "teacher1"
|
|
|
30 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
31 |
Then the field "perpage" matches value "20"
|
|
|
32 |
# Add 3 to the expected number because there are 2 header and 1 footer rows.
|
|
|
33 |
And I should see "23" node occurrences of type "tr" in the "user-grades" "table"
|
|
|
34 |
And I should see "3" in the ".stickyfooter .pagination" "css_element"
|
|
|
35 |
And I should not see "4" in the ".stickyfooter .pagination" "css_element"
|
|
|
36 |
|
|
|
37 |
@javascript
|
|
|
38 |
Scenario: Teachers can have their preference for the number of students
|
|
|
39 |
Given the following "courses" exist:
|
|
|
40 |
| fullname | shortname |
|
|
|
41 |
| Course 2 | C2 |
|
|
|
42 |
And the following "course enrolments" exist:
|
|
|
43 |
| user | course | role |
|
|
|
44 |
| teacher1 | C2 | editingteacher |
|
|
|
45 |
When I am on the "Course 1" "Course" page logged in as "teacher1"
|
|
|
46 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
47 |
And I set the field "perpage" to "100"
|
|
|
48 |
And I am on the "Course 2" "Course" page
|
|
|
49 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
50 |
Then the field "perpage" matches value "100"
|
|
|
51 |
|
|
|
52 |
@javascript
|
|
|
53 |
Scenario: Teachers can change the number of students shown on the report
|
|
|
54 |
Given "101" "users" exist with the following data:
|
|
|
55 |
| username | student[count] |
|
|
|
56 |
| firstname | Student |
|
|
|
57 |
| lastname | [count] |
|
|
|
58 |
| email | student[count]@example.com |
|
|
|
59 |
And "101" "course enrolments" exist with the following data:
|
|
|
60 |
| user | student[count] |
|
|
|
61 |
| course | C1 |
|
|
|
62 |
| role |student |
|
|
|
63 |
When I am on the "Course 1" "Course" page logged in as "teacher1"
|
|
|
64 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
65 |
And I set the field "perpage" to "100"
|
|
|
66 |
# Add 3 to the expected number because there are 2 header and 1 footer rows.
|
|
|
67 |
Then I should see "103" node occurrences of type "tr" in the "user-grades" "table"
|
|
|
68 |
And I should see "2" in the ".stickyfooter .pagination" "css_element"
|
|
|
69 |
And I should not see "3" in the ".stickyfooter .pagination" "css_element"
|
|
|
70 |
|
|
|
71 |
@javascript
|
|
|
72 |
Scenario: The pagination bar is only displayed when there is more than one page
|
|
|
73 |
Given "21" "users" exist with the following data:
|
|
|
74 |
| username | student[count] |
|
|
|
75 |
| firstname | Student |
|
|
|
76 |
| lastname | [count] |
|
|
|
77 |
| email | student[count]@example.com |
|
|
|
78 |
And "21" "course enrolments" exist with the following data:
|
|
|
79 |
| user | student[count] |
|
|
|
80 |
| course | C1 |
|
|
|
81 |
| role |student |
|
|
|
82 |
When I am on the "Course 1" "Course" page logged in as "teacher1"
|
|
|
83 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
84 |
# By default, we have 20 students per page.
|
|
|
85 |
Then ".stickyfooter .pagination" "css_element" should exist
|
|
|
86 |
And I set the field "perpage" to "100"
|
|
|
87 |
Then ".stickyfooter .pagination" "css_element" should not exist
|