MDL-18229 gradereport: Behat tests added.
[moodle.git] / grade / report / singleview / tests / behat / singleview.feature
CommitLineData
2fd9718d
ZD
1@core @core_grades @singleview
2Feature: We can use Single view
3 As a teacher
4 In order to view a user or an activities grades
5
6Background:
7 Given the following "courses" exist:
8 | fullname | shortname | category | groupmode |
9 | Course 1 | C1 | 0 | 1 |
10 And the following "users" exist:
11 | username | firstname | lastname | email | idnumber | alternatename |
12 | teacher1 | Teacher | 1 | teacher1@asd.com | t1 | teacherbro |
13 | student1 | Student | 1 | student1@asd.com | s1 | studentbro |
14 | student2 | Student | 2 | student1@asd.com | s2 | studentjo |
15 | student3 | Student | 3 | student1@asd.com | s3 | studentlo |
16 | student4 | Student | 4 | student1@asd.com | s4 | studentawesemo |
17 And the following "course enrolments" exist:
18 | user | course | role |
19 | teacher1 | C1 | editingteacher |
20 | student1 | C1 | student |
21 | student2 | C1 | student |
22 | student3 | C1 | student |
23 | student4 | C1 | student |
24 And the following "grade categories" exist:
25 | fullname | course |
26 | Sub category 1 | C1|
27 | Sub category 2 | C1|
28 And the following "activities" exist:
29 | activity | course | idnumber | name | intro | grade |
30 | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
31 | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
32 | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
33 | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
34 And the following "activities" exist:
35 | activity | course | idnumber | name | intro | gradecategory | grade |
36 | assign | C1 | a5 | Test assignment five | Submit something! | Sub category 1 | 200
37 | assign | C1 | a6 | Test assignment six | Submit something! | Sub category 1 | 100
38 | assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 150
39 And the following "activities" exist:
40 | activity | course | idnumber | name | intro | gradecategory | grade |
41 | assign | C1 | a8 | Test assignment eight | Submit something! | Sub category 2 | 200
42 | assign | C1 | a9 | Test assignment nine | Submit something! | Sub category 2 | 100
43 | assign | C1 | 10 | Test assignment ten | Submit nothing! | Sub category 2 | 150
44 And I log in as "teacher1"
45 And I follow "Course 1"
46 And I follow "Grades"
47
48@javascript
49Scenario: I can update grades, add feedback and exclude grades.
50 And I click on "Single view" "option"
51 And I click on "studentawesemo (Student) 4" "option"
52 And I click on "Override for Test assignment eight" "checkbox"
53 And I set the following fields to these values:
54 | Grade for Test assignment eight | 10.00 |
55 | Feedback for Test assignment eight | test data |
56 And I click on "Exclude for Test assignment four" "checkbox"
57 And I press "Update"
58 Then the following should exist in the "user-grades" table:
59 | Test assignment four |
60 | excluded |
61 Then the following should exist in the "user-grades" table:
62 | Test assignment eight |
63 | 10.00 |
64 And I click on "Single view for Test assignment five" "link"
65 And I click on "Override for studentbro (Student) 1" "checkbox"
66 And I set the following fields to these values:
67 | Grade for studentbro (Student) 1 | 12.05 |
68 | Feedback for studentbro (Student) 1 | test data2 |
69 And I click on "Exclude for studentjo (Student) 2" "checkbox"
70 And I press "Update"
71 Then the following should exist in the "user-grades" table:
72 | Test assignment five |
73 | 12.05 |
74 | Excluded |
75
76@javascript
77Scenario: Single view quick links work on grade report.
78 And I follow "Single view for Test assignment one"
79 And I follow "Grader report"
80 And I follow "Single view for Student 1"
81
82@javascript
83Scenario: Navigation works in the Single view.
84 And I click on "Single view" "option"
85 And I click on "studentbro (Student) 1" "option"
86 And I follow "studentjo (Student) 2"
87 And I follow "studentbro (Student) 1"
88 And I click on "Show grades for Test assignment five" "link"
89 And I follow "Test assignment six"
90 And I follow "Test assignment five"