MDL-30085 core_grades functions moved to correct location
[moodle.git] / grade / tests / behat / grade_view.feature
CommitLineData
8ff75385 1@core @core_grades
4e2ba4bb 2Feature: We can enter in grades and view reports from the gradebook
8ff75385
MN
3 In order to check the expected results are displayed
4 As a teacher
5 I need to assign grades and check that they display correctly in the gradebook.
4e2ba4bb 6 I need to enable grade weightings and check that they are displayed correctly.
8ff75385 7
4e2ba4bb 8 Background:
759b323e 9 Given the following "courses" exist:
8ff75385
MN
10 | fullname | shortname | format |
11 | Course 1 | C1 | topics |
759b323e 12 And the following "users" exist:
8ff75385
MN
13 | username | firstname | lastname | email |
14 | teacher1 | Teacher | 1 | teacher1@asd.com |
15 | student1 | Student | 1 | student1@asd.com |
759b323e 16 And the following "course enrolments" exist:
8ff75385
MN
17 | user | course | role |
18 | teacher1 | C1 | editingteacher |
19 | student1 | C1 | student |
20 And I log in as "teacher1"
21 And I follow "Course 1"
22 And I turn editing mode on
23 And I add a "Assignment" to section "1" and I fill the form with:
24 | Assignment name | Test assignment name |
25 | Description | Submit your online text |
26 | assignsubmission_onlinetext_enabled | 1 |
27 And I log out
28 And I log in as "student1"
29 And I follow "Course 1"
30 And I follow "Test assignment name"
31 When I press "Add submission"
f083d614 32 And I set the following fields to these values:
8ff75385
MN
33 | Online text | This is a submission |
34 And I press "Save changes"
35 Then I should see "Submitted for grading"
36 And I log out
37 And I log in as "teacher1"
38 And I follow "Course 1"
39 And I follow "Grades"
40 And I turn editing mode on
41 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name"
42 And I press "Update"
4e2ba4bb
AG
43
44 @javascript
45 Scenario: Grade a grade item and ensure the results display correctly in the gradebook
f083d614 46 When I set the field "Grade report" to "User report"
8ff75385
MN
47 And the "Grade report" select box should contain "Grader report"
48 And the "Grade report" select box should contain "Outcomes report"
49 And the "Grade report" select box should contain "User report"
50 And the "Select all or one user" select box should contain "All users (1)"
51 And I log out
52 And I log in as "student1"
53 And I follow "Course 1"
54 And I follow "Grades"
55 And I should see "80.00" in the "Test assignment name" "table_row"
f083d614 56 And I set the field "Grade report" to "Overview report"
8ff75385
MN
57 And I should see "80.00" in the "overview-grade" "table"
58
4e2ba4bb
AG
59 @javascript
60 Scenario: We can add a weighting to a grade item and it is displayed properly in the user report
f083d614
DM
61 When I set the field "Grade report" to "Full view"
62 And I set the field "Aggregation" to "Weighted mean of grades"
63 And I set the following fields to these values:
4e2ba4bb
AG
64 | Extra credit value for Test assignment name | 0.72 |
65 And I press "Save changes"
f083d614 66 And I set the field "Grade report" to "User report"
4e2ba4bb 67 And I follow "Course grade settings"
f083d614 68 And I set the following fields to these values:
4e2ba4bb
AG
69 | Show weightings | Show |
70 And I press "Save changes"
71 And I log out
72 And I log in as "student1"
73 And I follow "Course 1"
74 And I follow "Grades"
75 Then I should see "0.72" in the "Test assignment name" "table_row"
76 And I should not see "0.72%" in the "Test assignment name" "table_row"