2 Feature: Bulk enrolments
3 In order to manage a course site
5 I need to be able to bulk edit enrolments
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | student1 | Student | 1 | student1@example.com |
11 | student2 | Student | 2 | student2@example.com |
12 | teacher1 | Teacher | 1 | teacher1@example.com |
13 And the following "courses" exist:
14 | fullname | shortname | format |
15 | Course 1 | C1 | topics |
16 And the following "course enrolments" exist:
17 | user | course | role |
18 | student1 | C1 | student |
19 | student2 | C1 | student |
20 | teacher1 | C1 | editingteacher |
23 Scenario: Bulk edit enrolments
24 When I log in as "admin"
25 And I am on "Course 1" course homepage
26 And I follow "Participants"
27 And I press "Select all"
28 And I set the field "With selected users..." to "Edit selected user enrolments"
29 And I set the field "Alter status" to "Suspended"
30 And I press "Save changes"
31 Then I should see "Suspended" in the "Teacher 1" "table_row"
32 Then I should see "Suspended" in the "Student 1" "table_row"
33 And I should see "Suspended" in the "Student 2" "table_row"
36 Scenario: Bulk delete enrolments
37 When I log in as "admin"
38 And I am on "Course 1" course homepage
39 And I follow "Participants"
40 And I press "Select all"
41 And I set the field "With selected users..." to "Delete selected user enrolments"
42 And I press "Unenrol users"
43 Then I should not see "Student 1"
44 And I should not see "Student 2"
45 And I should not see "Teacher 1"