MDL-18229 gradereport: Fixes and improvements from review.
[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 |
13 | teacher1 | Teacher | 1 | teacher1@asd.com | t1 | teacherbro |
14 | student1 | Student | 1 | student1@asd.com | s1 | studentbro |
15 | student2 | Student | 2 | student1@asd.com | s2 | studentjo |
16 | student3 | Student | 3 | student1@asd.com | s3 | studentlo |
17 | student4 | Student | 4 | student1@asd.com | s4 | studentawesemo |
18 And the following "course enrolments" exist:
19 | user | course | role |
20 | teacher1 | C1 | editingteacher |
21 | student1 | C1 | student |
22 | student2 | C1 | student |
23 | student3 | C1 | student |
24 | student4 | C1 | student |
25 And the following "grade categories" exist:
26 | fullname | course |
27 | Sub category 1 | C1|
28 | Sub category 2 | C1|
29 And the following "activities" exist:
30 | activity | course | idnumber | name | intro | grade |
31 | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
32 | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
33 | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
34 | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
8ec7b088 35 Then I log in as "teacher1"
2fd9718d
ZD
36 And I follow "Course 1"
37 And I follow "Grades"
38
8ec7b088
ZD
39 @javascript
40 Scenario: I can update grades, add feedback and exclude grades.
41 Given I click on "Single view" "option"
42 Then I click on "studentawesemo (Student) 4" "option"
43 And I click on "Override for Test assignment one" "checkbox"
2fd9718d 44 And I set the following fields to these values:
8ec7b088
ZD
45 | Grade for Test assignment one | 10.00 |
46 | Feedback for Test assignment one | test data |
2fd9718d
ZD
47 And I click on "Exclude for Test assignment four" "checkbox"
48 And I press "Update"
49 Then the following should exist in the "user-grades" table:
50 | Test assignment four |
51 | excluded |
52 Then the following should exist in the "user-grades" table:
8ec7b088 53 | Test assignment one |
2fd9718d 54 | 10.00 |
8ec7b088 55 And I click on "Single view for Test assignment three" "link"
2fd9718d
ZD
56 And I click on "Override for studentbro (Student) 1" "checkbox"
57 And I set the following fields to these values:
58 | Grade for studentbro (Student) 1 | 12.05 |
59 | Feedback for studentbro (Student) 1 | test data2 |
60 And I click on "Exclude for studentjo (Student) 2" "checkbox"
61 And I press "Update"
62 Then the following should exist in the "user-grades" table:
8ec7b088 63 | Test assignment three |
2fd9718d
ZD
64 | 12.05 |
65 | Excluded |
66
8ec7b088
ZD
67 @javascript
68 Scenario: Single view quick links work on grade report.
69 Given I follow "Single view for Test assignment one"
70 Then I should see "Test assignment one"
71 Then I follow "Grader report"
2fd9718d 72 And I follow "Single view for Student 1"
8ec7b088 73 Then I should see "Student 1"
2fd9718d 74
8ec7b088
ZD
75 @javascript
76 Scenario: Navigation works in the Single view.
77 Given I click on "Single view" "option"
78 Then I click on "studentbro (Student) 1" "option"
79 Then I should see "Student 1"
2fd9718d 80 And I follow "studentjo (Student) 2"
8ec7b088 81 Then I should see "Student 2"
2fd9718d 82 And I follow "studentbro (Student) 1"
8ec7b088
ZD
83 Then I should see "Student 1"
84 And I click on "Show grades for Test assignment four" "link"
85 Then I should see "Test assignment four"
86 And I follow "Test assignment three"
87 Then I should see "Test assignment three"
88 And I follow "Test assignment four"
89 Then I should see "Test assignment four"