on-demand release 2.6beta+
[moodle.git] / group / tests / behat / create_groups.feature
CommitLineData
550d842e 1@core @core_group
e613fd90
DM
2Feature: Organize students into groups
3 In order to organize course activities in groups
5d7b6307 4 As a teacher
e613fd90
DM
5 I need to group students
6
7 @javascript
8 Scenario: Assign students to groups
9 Given the following "courses" exists:
10 | fullname | shortname | category | groupmode |
11 | Course 1 | C1 | 0 | 1 |
12 And the following "users" exists:
13 | username | firstname | lastname | email |
14 | teacher1 | Teacher | 1 | teacher1@asd.com |
15 | student0 | Student | 0 | student0@asd.com |
16 | student1 | Student | 1 | student1@asd.com |
17 | student2 | Student | 2 | student2@asd.com |
18 | student3 | Student | 3 | student3@asd.com |
19 And the following "course enrolments" exists:
20 | user | course | role |
21 | teacher1 | C1 | editingteacher |
22 | student0 | C1 | student |
23 | student1 | C1 | student |
24 | student2 | C1 | student |
25 | student3 | C1 | student |
26 And I log in as "teacher1"
27 And I follow "Course 1"
28 And I expand "Users" node
29 And I follow "Groups"
30 And I press "Create group"
31 And I fill the moodle form with:
32 | Group name | Group 1 |
33 And I press "Save changes"
34 And I press "Create group"
35 And I fill the moodle form with:
36 | Group name | Group 2 |
37 And I press "Save changes"
38 When I add "student0" user to "Group 1" group
39 And I add "student1" user to "Group 1" group
40 And I add "student2" user to "Group 2" group
41 And I add "student3" user to "Group 2" group
42 Then I select "Group 1 (2)" from "groups"
43 And I wait "5" seconds
44 And the "members" select box should contain "Student 0"
45 And the "members" select box should contain "Student 1"
46 And the "members" select box should not contain "Student 2"
47 And I select "Group 2 (2)" from "groups"
48 And I wait "5" seconds
49 And the "members" select box should contain "Student 2"
50 And the "members" select box should contain "Student 3"
51 And the "members" select box should not contain "Student 0"
52 And I follow "Participants"
53 And I select "Group 1" from "Separate groups"
54 And I should see "Student 0"
55 And I should see "Student 1"
56 And I should not see "Student 2"
57 And I select "Group 2" from "Separate groups"
58 And I should see "Student 2"
59 And I should see "Student 3"
60 And I should not see "Student 0"