From bdd0fce48d2f72470ed682a4a44ff2195109933b Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 21 Jun 2019 15:32:34 +0800 Subject: [PATCH] MDL-65965 availability: Behat test for activity grouping restriction --- .../tests/behat/availability_grouping.feature | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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"