From 74b25ba5fdbfad71aa897c956ac33812e182106e Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Wed, 16 Aug 2023 11:03:46 +0800 Subject: [PATCH] MDL-77695 behat: use automatic completion to award badges --- badges/tests/behat/award_badge.feature | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index 96e51b0184d..31bb51c8200 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -229,12 +229,19 @@ Feature: Award badges @javascript Scenario: Award badge on course completion - Given I log in as "teacher1" + Given the following "activity" exists: + | activity | chat | + | course | C1 | + | name | Music history | + | section | 1 | + | completion | 2 | + | completionview | 1 | + And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Course completion" in current page administration And I set the field "id_overall_aggregation" to "2" And I click on "Condition: Activity completion" "link" - And I set the field "Assignment - Test assignment name" to "1" + And I set the field "Chat - Music history" to "1" And I press "Save changes" And I am on "Course 1" course homepage And I navigate to "Badges > Add a new badge" in current page administration @@ -253,8 +260,7 @@ Feature: Award badges And I follow "Profile" in the user menu And I click on "Course 1" "link" in the "region-main" "region" Then I should not see "badges" - And I am on "Course 1" course homepage - And I toggle the manual completion state of "Test assignment name" + When I am on the "Music history" "chat activity" page And I log out # Completion cron won't mark the whole course completed unless the # individual criteria was marked completed more than a second ago. So @@ -265,6 +271,7 @@ Feature: Award badges # The student should now see their badge. And I log in as "student1" And I follow "Profile" in the user menu + And I click on "Course 1" "link" in the "region-main" "region" Then I should see "Course Badge" @javascript