MDL-49324 grades: Remove unnecessary @javascript tag from tests
[moodle.git] / grade / tests / behat / grade_to_pass.feature
CommitLineData
8164fad4
GF
1@core @core_grades
2Feature: We can set the grade to pass value
3 In order to set the grade to pass value
4 As a teacher
5 I assign a grade to pass to an activity while editing the activity.
6 I need to ensure that the grade to pass is visible in the gradebook.
7
8 Background:
9 Given the following "users" exist:
10 | username | firstname | lastname | email |
0fe86bbd 11 | teacher1 | Teacher | 1 | teacher1@example.com |
8164fad4
GF
12 And the following "courses" exist:
13 | fullname | shortname | format | numsections |
14 | Course 1 | C1 | weeks | 5 |
15 And the following "course enrolments" exist:
16 | user | course | role |
17 | teacher1 | C1 | editingteacher |
c977b350
MG
18 And the following "scales" exist:
19 | name | scale |
20 | Test Scale 1 | Disappointing, Good, Very good, Excellent |
8164fad4
GF
21 And I log in as "teacher1"
22 And I follow "Course 1"
8164fad4
GF
23
24 @javascript
25 Scenario: Validate that switching the type of grading used correctly disables grade to pass
c977b350
MG
26 When I turn editing mode on
27 And I add a "Assignment" to section "1"
8164fad4
GF
28 And I expand all fieldsets
29 And I set the field "grade[modgrade_type]" to "Point"
30 Then the "Grade to pass" "field" should be enabled
31 And I set the field "grade[modgrade_type]" to "None"
c977b350 32 And the "Grade to pass" "field" should be disabled
8164fad4
GF
33 And I press "Save and return to course"
34
35 @javascript
36 Scenario: Create an activity with a Grade to pass value greater than the maximum grade
c977b350
MG
37 When I turn editing mode on
38 And I add a "Assignment" to section "1" and I fill the form with:
39 | Assignment name | Test Assignment 1 |
40 | Description | Submit your online text |
41 | assignsubmission_onlinetext_enabled | 1 |
42 | grade[modgrade_type] | Point |
43 | grade[modgrade_point] | 50 |
44 | Grade to pass | 100 |
45 Then I should see "The grade to pass can not be greater than the maximum possible grade 50"
8164fad4
GF
46 And I press "Cancel"
47
c977b350
MG
48 Scenario: Set a valid grade to pass for an assignment activity using points
49 When I turn editing mode on
50 And I add a "Assignment" to section "1" and I fill the form with:
51 | Assignment name | Test Assignment 1 |
52 | Description | Submit your online text |
53 | assignsubmission_onlinetext_enabled | 1 |
54 | grade[modgrade_type] | Point |
55 | grade[modgrade_point] | 50 |
56 | Grade to pass | 25 |
4887d152 57 And I navigate to "Grades" node in "Course administration"
c977b350
MG
58 And I turn editing mode on
59 And I click on "Edit assign Test Assignment 1" "link"
60 Then the field "Grade to pass" matches value "25"
61 And I follow "Course 1"
62 And I follow "Test Assignment 1"
8164fad4
GF
63 And I follow "Edit settings"
64 And I expand all fieldsets
c977b350
MG
65 And I set the field "Grade to pass" to "30"
66 And I press "Save and return to course"
4887d152 67 And I navigate to "Grades" node in "Course administration"
c977b350
MG
68 And I click on "Edit assign Test Assignment 1" "link"
69 And the field "Grade to pass" matches value "30"
70
c977b350
MG
71 Scenario: Set a valid grade to pass for an assignment activity using scales
72 When I turn editing mode on
73 And I add a "Assignment" to section "1" and I fill the form with:
74 | Assignment name | Test Assignment 1 |
75 | Description | Submit your online text |
76 | grade[modgrade_type] | Scale |
77 | grade[modgrade_scale] | Test Scale 1 |
78 | Grade to pass | 3 |
4887d152 79 And I navigate to "Grades" node in "Course administration"
8164fad4
GF
80 And I turn editing mode on
81 And I click on "Edit assign Test Assignment 1" "link"
47f084c6 82 And I expand all fieldsets
c977b350
MG
83 Then the field "Grade to pass" matches value "3"
84 And I set the field "Grade to pass" to "4"
85 And I press "Save changes"
8164fad4 86 And I follow "Course 1"
c977b350
MG
87 And I follow "Test Assignment 1"
88 And I follow "Edit settings"
89 And the field "Grade to pass" matches value "4"
90
c977b350
MG
91 Scenario: Set a invalid grade to pass for an assignment activity using scales
92 When I turn editing mode on
93 And I add a "Assignment" to section "1" and I fill the form with:
94 | Assignment name | Test Assignment 1 |
95 | Description | Submit your online text |
96 | grade[modgrade_type] | Scale |
97 | grade[modgrade_scale] | Test Scale 1 |
98 | Grade to pass | 10 |
99 Then I should see "The grade to pass can not be greater than the maximum possible grade 4"
100
c977b350
MG
101 Scenario: Set a valid grade to pass for workshop activity
102 When I turn editing mode on
8164fad4
GF
103 And I add a "Workshop" to section "1" and I fill the form with:
104 | Workshop name | Test Workshop 1 |
105 | Description | Test workshop |
106 | grade | 80 |
c977b350 107 | Submission grade to pass | 40 |
8164fad4 108 | gradinggrade | 20 |
c977b350 109 | Assessment grade to pass | 10 |
4887d152 110 And I navigate to "Grades" node in "Course administration"
c977b350 111 And I turn editing mode on
8164fad4 112 And I click on "Edit workshop Test Workshop 1 (submission)" "link"
47f084c6 113 And I expand all fieldsets
8164fad4 114 Then the field "Grade to pass" matches value "40"
c977b350
MG
115 And I set the field "Grade to pass" to "45"
116 And I press "Save changes"
117 And I click on "Edit workshop Test Workshop 1 (assessment)" "link"
47f084c6 118 And I expand all fieldsets
c977b350
MG
119 And the field "Grade to pass" matches value "10"
120 And I set the field "Grade to pass" to "15"
121 And I press "Save changes"
122 And I follow "Course 1"
123 And I follow "Test Workshop 1"
124 And I follow "Edit settings"
125 And the field "Submission grade to pass" matches value "45"
126 And the field "Assessment grade to pass" matches value "15"
127
c977b350
MG
128 Scenario: Set an invalid grade to pass for workshop activity
129 When I turn editing mode on
130 And I add a "Workshop" to section "1" and I fill the form with:
131 | Workshop name | Test Workshop 1 |
132 | Description | Test workshop |
133 | grade | 80 |
134 | Submission grade to pass | 90 |
135 | gradinggrade | 20 |
136 | Assessment grade to pass | 30 |
137 Then "The grade to pass can not be greater than the maximum possible grade 80" "text" should exist in the "#fitem_id_submissiongradepass .error" "css_element"
138 Then "The grade to pass can not be greater than the maximum possible grade 20" "text" should exist in the "#fitem_id_gradinggradepass .error" "css_element"
139
c977b350
MG
140 Scenario: Set a valid grade to pass for quiz activity
141 When I turn editing mode on
142 And I add a "Quiz" to section "1" and I fill the form with:
143 | Name | Test Quiz 1 |
144 | Grade to pass | 9.5 |
4887d152 145 And I navigate to "Grades" node in "Course administration"
c977b350
MG
146 And I turn editing mode on
147 And I click on "Edit quiz Test Quiz 1" "link"
47f084c6 148 And I expand all fieldsets
c977b350
MG
149 Then the field "Grade to pass" matches value "9.5"
150 And I set the field "Grade to pass" to "8"
151 And I press "Save changes"
152 And I follow "Course 1"
153 And I follow "Test Quiz 1"
154 And I follow "Edit settings"
155 And the field "Grade to pass" matches value "8.00"
156
c977b350
MG
157 Scenario: Set a valid grade to pass for lesson activity
158 When I turn editing mode on
159 And I add a "Lesson" to section "1" and I fill the form with:
160 | Name | Test Lesson 1 |
161 | Description | Test |
162 | Grade to pass | 90 |
4887d152 163 And I navigate to "Grades" node in "Course administration"
c977b350
MG
164 And I turn editing mode on
165 And I click on "Edit lesson Test Lesson 1" "link"
47f084c6 166 And I expand all fieldsets
c977b350
MG
167 Then the field "Grade to pass" matches value "90"
168 And I set the field "Grade to pass" to "80"
169 And I press "Save changes"
170 And I follow "Course 1"
171 And I follow "Test Lesson 1"
172 And I follow "Edit settings"
173 And the field "Grade to pass" matches value "80"
174
c977b350
MG
175 Scenario: Set a valid grade to pass for database activity
176 When I turn editing mode on
177 And I add a "Database" to section "1" and I fill the form with:
178 | Name | Test Database 1 |
179 | Description | Test |
c977b350 180 | Aggregate type | Average of ratings |
bc5d93c7 181 | Grade to pass | 90 |
4887d152 182 And I navigate to "Grades" node in "Course administration"
c977b350
MG
183 And I turn editing mode on
184 And I click on "Edit data Test Database 1" "link"
47f084c6 185 And I expand all fieldsets
c977b350
MG
186 Then the field "Grade to pass" matches value "90"
187 And I set the field "Grade to pass" to "80"
188 And I press "Save changes"
189 And I follow "Course 1"
190 And I follow "Test Database 1"
191 And I follow "Edit settings"
192 And the field "Grade to pass" matches value "80"
193
c977b350
MG
194 Scenario: Set an invalid grade to pass for forum activity
195 When I turn editing mode on
196 And I add a "Forum" to section "1" and I fill the form with:
197 | Forum name | Test Forum 1 |
198 | Description | Test |
c977b350 199 | Aggregate type | Average of ratings |
bc5d93c7 200 | Grade to pass | 90 |
c977b350
MG
201 | scale[modgrade_point] | 60 |
202 Then I should see "The grade to pass can not be greater than the maximum possible grade 60"
203
c977b350
MG
204 Scenario: Set a valid grade to pass for forum activity
205 When I turn editing mode on
206 And I add a "Forum" to section "1" and I fill the form with:
207 | Forum name | Test Forum 1 |
208 | Description | Test |
c977b350 209 | Aggregate type | Average of ratings |
bc5d93c7 210 | Grade to pass | 90 |
4887d152 211 And I navigate to "Grades" node in "Course administration"
c977b350
MG
212 And I turn editing mode on
213 And I click on "Edit forum Test Forum 1" "link"
47f084c6 214 And I expand all fieldsets
c977b350
MG
215 Then the field "Grade to pass" matches value "90"
216 And I set the field "Grade to pass" to "80"
217 And I press "Save changes"
218 And I follow "Course 1"
219 And I follow "Test Forum 1"
220 And I follow "Edit settings"
221 And the field "Grade to pass" matches value "80"
222
c977b350
MG
223 Scenario: Set a valid grade to pass for glossary activity
224 When I turn editing mode on
225 And I add a "Glossary" to section "1" and I fill the form with:
226 | Name | Test Glossary 1 |
227 | Description | Test |
c977b350 228 | Aggregate type | Average of ratings |
bc5d93c7 229 | Grade to pass | 90 |
4887d152 230 And I navigate to "Grades" node in "Course administration"
c977b350
MG
231 And I turn editing mode on
232 And I click on "Edit glossary Test Glossary 1" "link"
47f084c6 233 And I expand all fieldsets
c977b350
MG
234 Then the field "Grade to pass" matches value "90"
235 And I set the field "Grade to pass" to "80"
236 And I press "Save changes"
237 And I follow "Course 1"
238 And I follow "Test Glossary 1"
239 And I follow "Edit settings"
240 And the field "Grade to pass" matches value "80"