From 963723bc4d5d11e46345a58483d5ad08e1f85156 Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Thu, 7 Dec 2023 13:15:05 +0800 Subject: [PATCH] MDL-80339 mod_lesson: Behat to confirm grade visibility in lesson --- .../behat/lesson_informations_at_end.feature | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mod/lesson/tests/behat/lesson_informations_at_end.feature b/mod/lesson/tests/behat/lesson_informations_at_end.feature index 63bcbee46fa..5f3c12bf83c 100644 --- a/mod/lesson/tests/behat/lesson_informations_at_end.feature +++ b/mod/lesson/tests/behat/lesson_informations_at_end.feature @@ -91,3 +91,22 @@ Feature: In a lesson activity, if custom scoring is not enabled, student should Then I should see "Congratulations - end of lesson reached" And I should see "Your score is 1 (out of 1)." And I should see "Your current grade is Excellent" + + Scenario: Verify lesson summary with grade type set to none + Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1 + # Since by default the grade type is point, change it to None. + And I set the field "grade[modgrade_type]" to "None" + And I press "Save and return to course" + # Answer the question incorrectly. + When I am on the "Test lesson name" "lesson activity" page logged in as student1 + And I press "Next page" + And I set the following fields to these values: + | Your answer | 1 | + And I press "Submit" + And I press "Continue" + # Confirm the information displayed at the end of lesson when grade type is set to None. + Then I should see "Congratulations - end of lesson reached" + And I should see "Number of questions answered: 1" + And I should see "Number of correct answers: 0" + And I should see "Your score is 0 (out of 1)." + And I should not see "Your current grade is 0.0 out of 75"