diff --git a/availability/condition/grouping/tests/behat/availability_grouping.feature b/availability/condition/grouping/tests/behat/availability_grouping.feature index 91f4d045d57..2e242309b9c 100644 --- a/availability/condition/grouping/tests/behat/availability_grouping.feature +++ b/availability/condition/grouping/tests/behat/availability_grouping.feature @@ -92,3 +92,25 @@ Feature: availability_grouping # P1 should show but not B2. Then I should see "P1" in the "region-main" "region" And I should not see "P2" in the "region-main" "region" + + @javascript + Scenario: Check grouping access restriction message on course homepage + Given the following "groupings" exist: + | name | course | idnumber | + | Grouping A | C1 | GA | + And the following "grouping groups" exist: + | grouping | group | + | GA | GI1 | + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | grouping | + | assign | Test assign | Assign description | C1 | assign1 | 1 | GA | + And I log in as "teacher1" + And I am on "Course 1" course homepage + And I turn editing mode on + And I open "Test assign" actions menu + And I choose "Edit settings" in the open action menu + And I expand all fieldsets + And the field "groupingid" matches value "Grouping A" + And I press "Add group/grouping access restriction" + When I press "Save and return to course" + Then I should see "Not available unless: You belong to a group in Grouping A"