Merge branch 'MDL-47713-master' of git://github.com/damyon/moodle
[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 |
2fd9718d
ZD
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 |
0a55da57 35 And I log in as "teacher1"
2fd9718d
ZD
36 And I follow "Course 1"
37 And I follow "Grades"
38
0a55da57 39 @javascript
8ec7b088
ZD
40 Scenario: I can update grades, add feedback and exclude grades.
41 Given I click on "Single view" "option"
f86233a4 42 And I click on "Student 4" "option"
8ec7b088 43 And I click on "Override for Test assignment one" "checkbox"
0a55da57 44 When 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"
f86233a4 49 Then the following should exist in the "generaltable" table:
2fd9718d
ZD
50 | Test assignment four |
51 | excluded |
f86233a4 52 And the following should exist in the "generaltable" table:
8ec7b088 53 | Test assignment one |
2fd9718d 54 | 10.00 |
f86233a4
ZD
55 And I click on "Show grades for Test assignment three" "link"
56 And I click on "Override for james (Student) 1" "checkbox"
2fd9718d 57 And I set the following fields to these values:
f86233a4
ZD
58 | Grade for james (Student) 1 | 12.05 |
59 | Feedback for james (Student) 1 | test data2 |
60 And I click on "Exclude for holly (Student) 2" "checkbox"
2fd9718d 61 And I press "Update"
f86233a4 62 And the following should exist in the "generaltable" table:
8ec7b088 63 | Test assignment three |
2fd9718d
ZD
64 | 12.05 |
65 | Excluded |
66
5f3decb5 67 Scenario: Single view links work on grade report.
8ec7b088
ZD
68 Given I follow "Single view for Test assignment one"
69 Then I should see "Test assignment one"
70 Then I follow "Grader report"
2fd9718d 71 And I follow "Single view for Student 1"
8ec7b088 72 Then I should see "Student 1"
2fd9718d 73
8ec7b088
ZD
74 @javascript
75 Scenario: Navigation works in the Single view.
76 Given I click on "Single view" "option"
f86233a4 77 Then I click on "Student 1" "option"
8ec7b088 78 Then I should see "Student 1"
f86233a4 79 And I follow "Student 2"
8ec7b088 80 Then I should see "Student 2"
f86233a4 81 And I follow "Student 1"
8ec7b088
ZD
82 Then I should see "Student 1"
83 And I click on "Show grades for Test assignment four" "link"
84 Then I should see "Test assignment four"
85 And I follow "Test assignment three"
86 Then I should see "Test assignment three"
87 And I follow "Test assignment four"
88 Then I should see "Test assignment four"