diff --git a/group/tests/behat/auto_creation.feature b/group/tests/behat/auto_creation.feature index f47db8e920f..d6754565558 100644 --- a/group/tests/behat/auto_creation.feature +++ b/group/tests/behat/auto_creation.feature @@ -11,7 +11,6 @@ Feature: Automatic creation of groups And the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | - | student0 | Student | 0 | student0@example.com | | student1 | Student | 1 | student1@example.com | | student2 | Student | 2 | student2@example.com | | student3 | Student | 3 | student3@example.com | @@ -21,19 +20,22 @@ Feature: Automatic creation of groups | student7 | Student | 7 | student7@example.com | | student8 | Student | 8 | student8@example.com | | student9 | Student | 9 | student9@example.com | + | student10 | Student | 10 | student10@example.com | + | suspendedstudent11 | Suspended student | 11 | suspendedstudent11@example.com | And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student0 | C1 | student | - | student1 | C1 | student | - | student2 | C1 | student | - | student3 | C1 | student | - | student4 | C1 | student | - | student5 | C1 | student | - | student6 | C1 | student | - | student7 | C1 | student | - | student8 | C1 | student | - | student9 | C1 | student | + | user | course | role | status | + | teacher1 | C1 | editingteacher | 0 | + | student1 | C1 | student | 0 | + | student2 | C1 | student | 0 | + | student3 | C1 | student | 0 | + | student4 | C1 | student | 0 | + | student5 | C1 | student | 0 | + | student6 | C1 | student | 0 | + | student7 | C1 | student | 0 | + | student8 | C1 | student | 0 | + | student9 | C1 | student | 0 | + | student10 | C1 | student | 0 | + | suspendedstudent11 | C1 | student | 1 | And I log in as "teacher1" And I follow "Course 1" And I expand "Users" node @@ -96,10 +98,10 @@ Feature: Automatic creation of groups And I set the following fields to these values: | Group name | Group 2 | And I press "Save changes" - When I add "Student 0" user to "Group 1" group members - And I add "Student 1" user to "Group 1" group members - And I add "Student 2" user to "Group 2" group members + When I add "Student 1" user to "Group 1" group members + And I add "Student 2" user to "Group 1" group members And I add "Student 3" user to "Group 2" group members + And I add "Student 4" user to "Group 2" group members And I press "Auto-create groups" And I expand all fieldsets And I set the field "Auto create based on" to "Number of groups" @@ -138,4 +140,18 @@ Feature: Automatic creation of groups | Grouping of auto-created groups | No grouping | And I press "Submit" And the "groups" select box should contain "Test 1 (3)" - And the "groups" select box should contain "Test 2 (2)" \ No newline at end of file + And the "groups" select box should contain "Test 2 (2)" + + Scenario: Exclude suspended users when auto-creating groups + Given I set the field "Include only active enrolments" to "1" + And I set the field "Auto create based on" to "Members per group" + When I set the field "Group/member count" to "11" + And I press "Preview" + Then I should not see "Suspended Student 11" + + Scenario: Include suspended users when auto-creating groups + Given I set the field "Include only active enrolments" to "0" + And I set the field "Auto create based on" to "Members per group" + When I set the field "Group/member count" to "11" + And I press "Preview" + Then I should see "Suspended student 11" \ No newline at end of file