From 2b98f0ea26b90238ee42b496341e0ded22bdff54 Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Wed, 18 May 2016 09:54:55 +0800 Subject: [PATCH] MDL-45390 gradebook: Behat tests for grade boundary issues. --- .../tests/behat/grade_letter_boundary.feature | 43 ++++++++++++++++++ .../grade_letter_boundary_20160511.feature | 44 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 grade/tests/behat/grade_letter_boundary.feature create mode 100644 grade/tests/behat/grade_letter_boundary_20160511.feature diff --git a/grade/tests/behat/grade_letter_boundary.feature b/grade/tests/behat/grade_letter_boundary.feature new file mode 100644 index 00000000000..210732ae9a8 --- /dev/null +++ b/grade/tests/behat/grade_letter_boundary.feature @@ -0,0 +1,43 @@ +@core @core_grades +Feature: We can customise the letter boundary of a course. + In order to change the letter boundary of a course + As a teacher + I need to add assessments to the gradebook. + + @javascript + Scenario: I edit the letter boundaries of a course and grade a student. + Given the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And the following "users" exist: + | username | firstname | lastname | email | idnumber | alternatename | + | teacher1 | Teacher | 1 | teacher1@example.com | t1 | Terry | + | student1 | Student | 1 | student1@example.com | s1 | Sally | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + And the following "activities" exist: + | activity | course | idnumber | name | intro | grade | + | assign | C1 | a1 | Test assignment one | Submit something! | 100 | + And I log in as "teacher1" + And I follow "Course 1" + And I navigate to "Grades" node in "Course administration" + And I select "Course grade settings" from the "Grade report" singleselect + And I set the following fields to these values: + | Grade display type | Letter | + And I press "Save changes" + And I navigate to "Letters" node in "Grade administration" + And I follow "Edit grade letters" + And I set the following fields to these values: + | id_override | 1 | + | id_gradeboundary10 | 57 | + And I press "Save changes" + And I select "Grader report" from the "Grade report" singleselect + And I press "Turn editing on" + And I give the grade "57" to the user "Student 1" for the grade item "Test assignment one" + And I press "Save changes" + And I press "Turn editing off" + Then the following should exist in the "user-grades" table: + | -1- | -4- | -5- | + | Student 1 | D | D | \ No newline at end of file diff --git a/grade/tests/behat/grade_letter_boundary_20160511.feature b/grade/tests/behat/grade_letter_boundary_20160511.feature new file mode 100644 index 00000000000..197ba49f47a --- /dev/null +++ b/grade/tests/behat/grade_letter_boundary_20160511.feature @@ -0,0 +1,44 @@ +@core @core_grades +Feature: We can customise the letter boundary of a course. + In order to change the letter boundary of a course + As a teacher + I need to add assessments to the gradebook. + + @javascript + Scenario: I edit the letter boundaries of a course and grade a student. + Given the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And gradebook calculations for the course "C1" are frozen at version "20160511" + And the following "users" exist: + | username | firstname | lastname | email | idnumber | alternatename | + | teacher1 | Teacher | 1 | teacher1@example.com | t1 | Terry | + | student1 | Student | 1 | student1@example.com | s1 | Sally | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + And the following "activities" exist: + | activity | course | idnumber | name | intro | grade | + | assign | C1 | a1 | Test assignment one | Submit something! | 100 | + And I log in as "teacher1" + And I follow "Course 1" + And I navigate to "Grades" node in "Course administration" + And I select "Course grade settings" from the "Grade report" singleselect + And I set the following fields to these values: + | Grade display type | Letter | + And I press "Save changes" + And I navigate to "Letters" node in "Grade administration" + And I follow "Edit grade letters" + And I set the following fields to these values: + | id_override | 1 | + | id_gradeboundary10 | 57 | + And I press "Save changes" + And I select "Grader report" from the "Grade report" singleselect + And I press "Turn editing on" + And I give the grade "57" to the user "Student 1" for the grade item "Test assignment one" + And I press "Save changes" + And I press "Turn editing off" + Then the following should exist in the "user-grades" table: + | -1- | -4- | -5- | + | Student 1 | F | F | \ No newline at end of file