Skip to content

Commit

Permalink
MDL-48634 core: changes to automated tests to pass with changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Feb 9, 2016
1 parent 5af1321 commit a3dd8be
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 deletions.
2 changes: 2 additions & 0 deletions grade/tests/behat/grade_aggregation.feature
Expand Up @@ -425,6 +425,7 @@ Feature: We can use calculated grade totals
And I set the following settings for grade item "Manual item 2": And I set the following settings for grade item "Manual item 2":
| Extra credit | 0 | | Extra credit | 0 |
| Maximum grade | 200 | | Maximum grade | 200 |
| Rescale existing grades | No |
And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2" And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2"
And I press "Save changes" And I press "Save changes"
And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2" And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2"
Expand All @@ -435,6 +436,7 @@ Feature: We can use calculated grade totals
And I set the following settings for grade item "Manual item 2": And I set the following settings for grade item "Manual item 2":
| Extra credit | 0 | | Extra credit | 0 |
| Maximum grade | 100 | | Maximum grade | 100 |
| Rescale existing grades | No |
And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2" And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2"
And I press "Save changes" And I press "Save changes"
And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2" And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2"
Expand Down
1 change: 1 addition & 0 deletions grade/tests/behat/grade_calculated_grade_items.feature
Expand Up @@ -145,6 +145,7 @@ Feature: Calculated grade items can be used in the gradebook
| Course total | - | 112.50 | 0150 | 75.00 % | - | | Course total | - | 112.50 | 0150 | 75.00 % | - |
And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "calc item": And I set the following settings for grade item "calc item":
| Rescale existing grades | No |
| Maximum grade | 40 | | Maximum grade | 40 |
And I follow "Grader report" And I follow "Grader report"
And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1" And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1"
Expand Down
Expand Up @@ -146,6 +146,7 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506
| Course total | - | 112.50 | 0200 | 56.25 % | - | | Course total | - | 112.50 | 0200 | 56.25 % | - |
And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "calc item": And I set the following settings for grade item "calc item":
| Rescale existing grades | No |
| Maximum grade | 40 | | Maximum grade | 40 |
And I follow "Grader report" And I follow "Grader report"
And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1" And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1"
Expand Down
11 changes: 7 additions & 4 deletions grade/tests/behat/grade_minmax.feature
Expand Up @@ -100,11 +100,13 @@ Feature: We can choose what min or max grade to use when aggregating grades.
| Course total | - | 60.00 | 0300 | 20.00 % | - | | Course total | - | 60.00 | 0300 | 20.00 % | - |
And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "MI 1": And I set the following settings for grade item "MI 1":
| Maximum grade | 50.00 | | Maximum grade | 50.00 |
| Minimum grade | 5.00 | | Minimum grade | 5.00 |
| Rescale existing grades | No |
And I set the following settings for grade item "MI 3": And I set the following settings for grade item "MI 3":
| Maximum grade | 50.00 | | Maximum grade | 50.00 |
| Minimum grade | 5.00 | | Minimum grade | 5.00 |
| Rescale existing grades | No |
And I follow "User report" And I follow "User report"
And I select "Student 1" from the "Select all or one user" singleselect And I select "Student 1" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table: And the following should exist in the "user-grade" table:
Expand All @@ -129,6 +131,7 @@ Feature: We can choose what min or max grade to use when aggregating grades.
And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "MI 5": And I set the following settings for grade item "MI 5":
| Maximum grade | 200.00 | | Maximum grade | 200.00 |
| Rescale existing grades | No |
And I follow "User report" And I follow "User report"
And I select "Student 1" from the "Select all or one user" singleselect And I select "Student 1" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table: And the following should exist in the "user-grade" table:
Expand Down
14 changes: 7 additions & 7 deletions grade/tests/behat/grade_point_maximum.feature
Expand Up @@ -29,13 +29,13 @@ Feature: We can change the grading type and maximum grade point values
And I expand all fieldsets And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point" And I set the field "grade[modgrade_type]" to "Point"
Then the "Scale" "select" should be disabled Then the "Scale" "select" should be disabled
And the "Maximum points" "field" should be enabled And the "Maximum grade" "field" should be enabled
And I set the field "grade[modgrade_type]" to "Scale" And I set the field "grade[modgrade_type]" to "Scale"
And the "Maximum points" "field" should be disabled And the "Maximum grade" "field" should be disabled
Then the "Scale" "select" should be enabled Then the "Scale" "select" should be enabled
And I set the field "grade[modgrade_type]" to "None" And I set the field "grade[modgrade_type]" to "None"
Then the "Scale" "select" should be disabled Then the "Scale" "select" should be disabled
And the "Maximum points" "field" should be disabled And the "Maximum grade" "field" should be disabled
And I press "Save and return to course" And I press "Save and return to course"


@javascript @javascript
Expand All @@ -61,7 +61,7 @@ Feature: We can change the grading type and maximum grade point values
And I press "Save and display" And I press "Save and display"
And I follow "Edit settings" And I follow "Edit settings"
Then the field "grade[modgrade_scale]" matches value "Separate and Connected ways of knowing" Then the field "grade[modgrade_scale]" matches value "Separate and Connected ways of knowing"
And the "Maximum points" "field" should be disabled And the "Maximum grade" "field" should be disabled
And I press "Save and return to course" And I press "Save and return to course"


@javascript @javascript
Expand All @@ -73,7 +73,7 @@ Feature: We can change the grading type and maximum grade point values
And I press "Save and display" And I press "Save and display"
And I follow "Edit settings" And I follow "Edit settings"
And the "Scale" "select" should be disabled And the "Scale" "select" should be disabled
And the "Maximum points" "field" should be disabled And the "Maximum grade" "field" should be disabled
And I press "Save and return to course" And I press "Save and return to course"


@javascript @javascript
Expand All @@ -84,7 +84,7 @@ Feature: We can change the grading type and maximum grade point values
And I set the field "grade[modgrade_type]" to "Point" And I set the field "grade[modgrade_type]" to "Point"
And I set the field "grade[modgrade_point]" to "20000" And I set the field "grade[modgrade_point]" to "20000"
And I press "Save and display" And I press "Save and display"
Then I should see "Invalid Grade Value. This must be an integer between 1 and 900" Then I should see "Invalid grade value. This must be an integer between 1 and 900"
And I press "Cancel" And I press "Cancel"


@javascript @javascript
Expand All @@ -104,5 +104,5 @@ Feature: We can change the grading type and maximum grade point values
And I follow "Test Assignment 1" And I follow "Test Assignment 1"
And I follow "Edit settings" And I follow "Edit settings"
And I press "Save and display" And I press "Save and display"
Then I should see "Invalid Grade Value. This must be an integer between 1 and 100" Then I should see "Invalid grade value. This must be an integer between 1 and 100"
And I press "Cancel" And I press "Cancel"
2 changes: 1 addition & 1 deletion grade/tests/behat/grade_scales_aggregation.feature
Expand Up @@ -37,7 +37,7 @@ Feature: Control the aggregation of the scales
And I log out And I log out


@javascript @javascript
Scenario Outline: Scales can be exluded from aggregation Scenario Outline: Scales can be excluded from aggregation
Given I log in as "teacher1" Given I log in as "teacher1"
And I follow "Course 1" And I follow "Course 1"
And I navigate to "Grades" node in "Course administration" And I navigate to "Grades" node in "Course administration"
Expand Down
8 changes: 4 additions & 4 deletions mod/assign/tests/behat/rescale_grades.feature
Expand Up @@ -36,7 +36,7 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
Scenario: Update the max grade for an assignment without rescaling existing grades Scenario: Update the max grade for an assignment without rescaling existing grades
Given I follow "Edit settings" Given I follow "Edit settings"
And I expand all fieldsets And I expand all fieldsets
And I set the field "Maximum points" to "80" And I set the field "Maximum grade" to "80"
And I set the field "Rescale existing grades" to "No" And I set the field "Rescale existing grades" to "No"
When I press "Save and display" When I press "Save and display"
And I follow "View/grade all submissions" And I follow "View/grade all submissions"
Expand All @@ -45,7 +45,7 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
Scenario: Update the max grade for an assignment rescaling existing grades Scenario: Update the max grade for an assignment rescaling existing grades
Given I follow "Edit settings" Given I follow "Edit settings"
And I expand all fieldsets And I expand all fieldsets
And I set the field "Maximum points" to "50" And I set the field "Maximum grade" to "50"
And I set the field "Rescale existing grades" to "Yes" And I set the field "Rescale existing grades" to "Yes"
When I press "Save and display" When I press "Save and display"
And I follow "View/grade all submissions" And I follow "View/grade all submissions"
Expand All @@ -54,13 +54,13 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
Scenario: A rescale existing grades is not needed when keeping max grade unchanged Scenario: A rescale existing grades is not needed when keeping max grade unchanged
Given I follow "Edit settings" Given I follow "Edit settings"
And I expand all fieldsets And I expand all fieldsets
And I set the field "Maximum points" to "100" And I set the field "Maximum grade" to "100"
When I press "Save and display" When I press "Save and display"
Then I should not see "You must choose whether to rescale existing grades or not." Then I should not see "You must choose whether to rescale existing grades or not."


Scenario: A rescale existing grades must be selected when max grade changes Scenario: A rescale existing grades must be selected when max grade changes
Given I follow "Edit settings" Given I follow "Edit settings"
And I expand all fieldsets And I expand all fieldsets
And I set the field "Maximum points" to "50" And I set the field "Maximum grade" to "50"
When I press "Save and display" When I press "Save and display"
Then I should see "You must choose whether to rescale existing grades or not." Then I should see "You must choose whether to rescale existing grades or not."

0 comments on commit a3dd8be

Please sign in to comment.