1 @core_enrol @core_group
2 Feature: Users can be added to multiple groups at once
3 In order to manage group membership effectively
5 I need to add another user to multiple groups
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher1 | Teacher | 1 | teacher1@example.com |
11 | student1 | Student | 1 | student1@example.com |
12 And the following "courses" exist:
13 | fullname | shortname | format |
14 | Course 1 | C1 | topics |
15 And the following "groups" exist:
16 | name | course | idnumber |
20 And the following "course enrolments" exist:
21 | user | course | role |
22 | teacher1 | C1 | editingteacher |
23 | student1 | C1 | editingteacher |
26 Scenario: Adding a user to one group
27 Given I log in as "teacher1"
28 And I am on "Course 1" course homepage
29 And I follow "Participants"
30 And I click on "Edit groups for \"Student 1\"" "link" in the "student1" "table_row"
31 And I open the autocomplete suggestions list
32 And I click on "Group 1" item in the autocomplete list
33 And I open the autocomplete suggestions list
34 And I click on "Group 2" item in the autocomplete list
35 And I click on "Save changes" "link"
36 Then I should see "Group 1, Group 2"
39 Scenario: Adding a user to multiple group
40 Given I log in as "teacher1"
41 And I am on "Course 1" course homepage
42 And I navigate to "Enrolled users" node in "Course administration > Users"
43 And I click on "Add user into group" "link" in the "student1" "table_row"
44 When I set the field "Add user into group" to "Group 1, Group 2, Group 3"
45 And I press "Save changes"
46 Then I should see "Group 1"
47 And I should see "Group 2"
48 And I should see "Group 3"