1 |
efrain |
1 |
@gradereport @gradereport_singleview @javascript
|
|
|
2 |
Feature: Singleview 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 |
And the following "activities" exist:
|
|
|
18 |
| activity | course | idnumber | name | intro | grade |
|
|
|
19 |
| assign | C1 | a1 | Test assignment one | Submit something! | 300 |
|
|
|
20 |
|
|
|
21 |
Scenario: Default is used when teachers have no preference yet on singleview report
|
|
|
22 |
Given "41" "users" exist with the following data:
|
|
|
23 |
| username | student[count] |
|
|
|
24 |
| firstname | Student |
|
|
|
25 |
| lastname | [count] |
|
|
|
26 |
| email | student[count]@example.com |
|
|
|
27 |
And "41" "course enrolments" exist with the following data:
|
|
|
28 |
| user | student[count] |
|
|
|
29 |
| course | C1 |
|
|
|
30 |
| role |student |
|
|
|
31 |
When I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
|
|
|
32 |
And I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
|
|
|
33 |
And I choose "Single view for this item" in the open action menu
|
|
|
34 |
Then the field "perpage" matches value "20"
|
|
|
35 |
# There is also 1 header row.
|
|
|
36 |
And I should see "21" node occurrences of type "tr" in the "singleview-grades" "table"
|
|
|
37 |
And I should see "3" in the ".stickyfooter .pagination" "css_element"
|
|
|
38 |
And I should not see "4" in the ".stickyfooter .pagination" "css_element"
|
|
|
39 |
|
|
|
40 |
Scenario: Teachers can have their preference for the number of students on singleview report
|
|
|
41 |
Given the following "courses" exist:
|
|
|
42 |
| fullname | shortname |
|
|
|
43 |
| Course 2 | C2 |
|
|
|
44 |
And the following "course enrolments" exist:
|
|
|
45 |
| user | course | role |
|
|
|
46 |
| teacher1 | C2 | editingteacher |
|
|
|
47 |
And the following "activities" exist:
|
|
|
48 |
| activity | course | idnumber | name | intro | grade |
|
|
|
49 |
| assign | C2 | a2 | Test assignment two | Submit something! | 300 |
|
|
|
50 |
When I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
|
|
|
51 |
And I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
|
|
|
52 |
And I choose "Single view for this item" in the open action menu
|
|
|
53 |
And I set the field "perpage" to "100"
|
|
|
54 |
And I am on the "Course 2" "grades > Grader report > View" page
|
|
|
55 |
And I click on grade item menu "Test assignment two" of type "gradeitem" on "grader" page
|
|
|
56 |
And I choose "Single view for this item" in the open action menu
|
|
|
57 |
Then the field "perpage" matches value "100"
|
|
|
58 |
|
|
|
59 |
Scenario: Teachers can change the number of students shown on singleview report
|
|
|
60 |
Given "101" "users" exist with the following data:
|
|
|
61 |
| username | student[count] |
|
|
|
62 |
| firstname | Student |
|
|
|
63 |
| lastname | [count] |
|
|
|
64 |
| email | student[count]@example.com |
|
|
|
65 |
And "101" "course enrolments" exist with the following data:
|
|
|
66 |
| user | student[count] |
|
|
|
67 |
| course | C1 |
|
|
|
68 |
| role |student |
|
|
|
69 |
When I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
|
|
|
70 |
And I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
|
|
|
71 |
And I choose "Single view for this item" in the open action menu
|
|
|
72 |
And I set the field "perpage" to "100"
|
|
|
73 |
# There is also 1 header row.
|
|
|
74 |
Then I should see "101" node occurrences of type "tr" in the "singleview-grades" "table"
|
|
|
75 |
And I should see "2" in the ".stickyfooter .pagination" "css_element"
|
|
|
76 |
And I should not see "3" in the ".stickyfooter .pagination" "css_element"
|
|
|
77 |
|
|
|
78 |
@javascript
|
|
|
79 |
Scenario: The pagination bar is only displayed when there is more than one page on singleview report
|
|
|
80 |
Given "21" "users" exist with the following data:
|
|
|
81 |
| username | student[count] |
|
|
|
82 |
| firstname | Student |
|
|
|
83 |
| lastname | [count] |
|
|
|
84 |
| email | student[count]@example.com |
|
|
|
85 |
And "21" "course enrolments" exist with the following data:
|
|
|
86 |
| user | student[count] |
|
|
|
87 |
| course | C1 |
|
|
|
88 |
| role |student |
|
|
|
89 |
When I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
|
|
|
90 |
And I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
|
|
|
91 |
And I choose "Single view for this item" in the open action menu
|
|
|
92 |
# By default, we have 20 students per page.
|
|
|
93 |
And ".stickyfooter .pagination" "css_element" should exist
|
|
|
94 |
And I set the field "perpage" to "100"
|
|
|
95 |
Then ".stickyfooter .pagination" "css_element" should not exist
|