weekly release 2.9dev
[moodle.git] / grade / report / singleview / tests / behat / singleview.feature
CommitLineData
8ec7b088 1@core @core_grades @gradereport_singleview
2fd9718d
ZD
2Feature: We can use Single view
3 As a teacher
8ec7b088
ZD
4 In order to view and edit grades
5 For users and activities for a course.
2fd9718d 6
8ec7b088 7 Background:
2fd9718d 8 Given the following "courses" exist:
8ec7b088
ZD
9 | fullname | shortname | category |
10 | Course 1 | C1 | 0 |
2fd9718d
ZD
11 And the following "users" exist:
12 | username | firstname | lastname | email | idnumber | alternatename |
f86233a4
ZD
13 | teacher1 | Teacher | 1 | teacher1@asd.com | t1 | fred |
14 | student1 | Student | 1 | student1@asd.com | s1 | james |
15 | student2 | Student | 2 | student1@asd.com | s2 | holly |
16 | student3 | Student | 3 | student1@asd.com | s3 | anna |
17 | student4 | Student | 4 | student1@asd.com | s4 | zac |
7c5721f9
ZD
18 And the following "scales" exist:
19 | name | scale |
20 | Test Scale | Disappointing, Good, Very good, Excellent |
237f76ce 21 And the following "grade items" exist:
7c5721f9
ZD
22 | itemname | course | gradetype | scale |
23 | new grade item 1 | C1 | Scale | Test Scale |
24 And the following "scales" exist:
25 | name | scale |
26 | Test Scale | Disappointing, Good, Very good, Excellent |
2fd9718d
ZD
27 And the following "course enrolments" exist:
28 | user | course | role |
29 | teacher1 | C1 | editingteacher |
30 | student1 | C1 | student |
31 | student2 | C1 | student |
32 | student3 | C1 | student |
33 | student4 | C1 | student |
34 And the following "grade categories" exist:
35 | fullname | course |
36 | Sub category 1 | C1|
37 | Sub category 2 | C1|
38 And the following "activities" exist:
39 | activity | course | idnumber | name | intro | grade |
40 | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
41 | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
42 | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
43 | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
7c5721f9
ZD
44 And the following "grade items" exist:
45 | itemname | course | gradetype |
46 | Test grade item | C1 | Scale |
0a55da57 47 And I log in as "teacher1"
2fd9718d
ZD
48 And I follow "Course 1"
49 And I follow "Grades"
50
237f76ce 51 @javascript
8ec7b088
ZD
52 Scenario: I can update grades, add feedback and exclude grades.
53 Given I click on "Single view" "option"
f86233a4 54 And I click on "Student 4" "option"
8ec7b088 55 And I click on "Override for Test assignment one" "checkbox"
0a55da57 56 When I set the following fields to these values:
8ec7b088
ZD
57 | Grade for Test assignment one | 10.00 |
58 | Feedback for Test assignment one | test data |
2fd9718d
ZD
59 And I click on "Exclude for Test assignment four" "checkbox"
60 And I press "Update"
50e30bd4
ZD
61 Then I should see "Grades were set for 2 items"
62 And I press "Continue"
63 And the following should exist in the "generaltable" table:
2fd9718d
ZD
64 | Test assignment four |
65 | excluded |
f86233a4 66 And the following should exist in the "generaltable" table:
8ec7b088 67 | Test assignment one |
2fd9718d 68 | 10.00 |
831829dd
AG
69 And I set the following fields to these values:
70 | Test grade item | 45 |
71 And I press "Update"
72 Then I should see "Grades were set for 1 items"
73 And I press "Continue"
74 And the field "Grade for Test grade item" matches value "45.00"
75 And the field "Grade for Course total" matches value "55.00"
f86233a4
ZD
76 And I click on "Show grades for Test assignment three" "link"
77 And I click on "Override for james (Student) 1" "checkbox"
2fd9718d 78 And I set the following fields to these values:
f86233a4
ZD
79 | Grade for james (Student) 1 | 12.05 |
80 | Feedback for james (Student) 1 | test data2 |
81 And I click on "Exclude for holly (Student) 2" "checkbox"
2fd9718d 82 And I press "Update"
50e30bd4
ZD
83 Then I should see "Grades were set for 2 items"
84 And I press "Continue"
f86233a4 85 And the following should exist in the "generaltable" table:
8ec7b088 86 | Test assignment three |
2fd9718d
ZD
87 | 12.05 |
88 | Excluded |
7c5721f9
ZD
89 And I click on "Single view" "link"
90 And I click on "new grade item 1" "option"
91 And I click on "Very good" "option"
92 And I press "Update"
50e30bd4
ZD
93 Then I should see "Grades were set for 1 items"
94 And I press "Continue"
7c5721f9
ZD
95 And the following should exist in the "generaltable" table:
96 | Grade for james (Student) 1 | "Very good" |
2fd9718d 97
5f3decb5 98 Scenario: Single view links work on grade report.
8ec7b088
ZD
99 Given I follow "Single view for Test assignment one"
100 Then I should see "Test assignment one"
101 Then I follow "Grader report"
2fd9718d 102 And I follow "Single view for Student 1"
8ec7b088 103 Then I should see "Student 1"
2fd9718d 104
dd01789b
JC
105 @javascript
106 Scenario: I can bulk update grades.
107 Given I follow "Single view for Student 1"
108 Then I should see "Student 1"
109 When I click on "All grades" "option"
110 And I set the field "Insert value" to "1.0"
111 And I click on "Perform bulk insert" "checkbox"
112 And I press "Update"
113 Then I should see "Grades were set for 9 items"
114
8ec7b088 115 Scenario: Navigation works in the Single view.
237f76ce 116 Given I follow "Single view for Student 1"
8ec7b088 117 Then I should see "Student 1"
f86233a4 118 And I follow "Student 2"
8ec7b088 119 Then I should see "Student 2"
f86233a4 120 And I follow "Student 1"
8ec7b088
ZD
121 Then I should see "Student 1"
122 And I click on "Show grades for Test assignment four" "link"
123 Then I should see "Test assignment four"
124 And I follow "Test assignment three"
125 Then I should see "Test assignment three"
126 And I follow "Test assignment four"
127 Then I should see "Test assignment four"
237f76ce
ZD
128
129 Scenario: Activities are clickable only when
130 it has a valid activity page.
131 Given I follow "Single view for Student 1"
132 And "new grade item 1" "link" should not exist in the "//tbody//tr[position()=1]//td[position()=2]" "xpath_element"
133 Then "Category total" "link" should not exist in the "//tbody//tr[position()=2]//td[position()=2]" "xpath_element"
134 And "Course total" "link" should not exist in the "//tbody//tr[position()=last()]//td[position()=2]" "xpath_element"