From 0cc5f72f82cd87ec57b920e76291c6b25cc6d61e Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Wed, 29 May 2024 17:21:46 +0800 Subject: [PATCH] MDL-81249 gradingform: Behat test that grades are retained --- .../tests/behat/assign_marking_guide.feature | 28 +++++++++++++++++++ .../tests/behat/delete_marking_guide.feature | 4 +-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/grade/grading/form/guide/tests/behat/assign_marking_guide.feature b/grade/grading/form/guide/tests/behat/assign_marking_guide.feature index 3e5ad73b704..9336cd303b8 100644 --- a/grade/grading/form/guide/tests/behat/assign_marking_guide.feature +++ b/grade/grading/form/guide/tests/behat/assign_marking_guide.feature @@ -70,3 +70,31 @@ Feature: Display marking guide information to students | criteria | description | remark | maxscore | criteriascore | | Grade Criteria 1 | Grade 1 description for students | Excellent work! | 70 | 50 / 70 | | Grade Criteria 2 | Grade 2 description for students | Try harder | 30 | 20 / 30 | + + Scenario: Confirm that marking guide definition is retained when grading method is changed + Given I am on the "Assign 1" "assign activity" page + And I go to "Student 1" "Assign 1" activity advanced grading page + And I grade by filling the marking guide with: + | Grade Criteria 1 | 70 | Well done! | + | Grade Criteria 2 | 20 | Great work | + And I press "Save changes" + And I am on the "Assign 1" "assign activity editing" page + And I set the following fields to these values: + | Grading method | Simple direct grading | + And I press "Save and return to course" + When I go to "Assign 1" advanced grading page + Then I should not see "Assign 1 marking guide Ready for use" + And I should not see "Grade Critera 1" + And I should not see "Grade Critera 2" + And I am on the "Course 1" "grades > Grader report > View" page + And the following should exist in the "user-grades" table: + | -1- | -1- | -3- | + | Student 1 | student1@example.com | 90 | + And I am on the "Assign 1" "assign activity editing" page + And I set the following fields to these values: + | Grading method | Marking guide | + And I press "Save and return to course" + And I go to "Assign 1" advanced grading page + And I should see "Assign 1 marking guide Ready for use" + And I should see "Grade Criteria 1" + And I should see "Grade Criteria 2" diff --git a/grade/grading/form/guide/tests/behat/delete_marking_guide.feature b/grade/grading/form/guide/tests/behat/delete_marking_guide.feature index 2f2d9841261..06abc20e352 100644 --- a/grade/grading/form/guide/tests/behat/delete_marking_guide.feature +++ b/grade/grading/form/guide/tests/behat/delete_marking_guide.feature @@ -34,7 +34,6 @@ Feature: Teacher can delete marking guide And I grade by filling the marking guide with: | Criterion 1 | 70 | Well done! | And I press "Save changes" - And I am on the "Course 1" course page And I go to "Assign 1" advanced grading page When I click on "Delete the currently defined form" "link" Then I should see "You are going to delete the grading form 'Marking guide 1' and all the associated information from 'Assign 1 (Submissions)'" @@ -48,8 +47,7 @@ Feature: Teacher can delete marking guide And I should see "Please note: the advanced grading form is not ready at the moment. Simple grading method will be used until the form has a valid status." And I should not see "Marking guide 1 Ready for use" And I should not see "Criterion 1" - And I am on the "Course 1" course page - And I navigate to "View > Grader report" in the course gradebook + And I am on the "Course 1" "grades > Grader report > View" page And the following should exist in the "user-grades" table: | -1- | -1- | -3- | | Student One | student1@example.com | 70 |