2 Feature: Add cohorts of users
3 In order to create site-wide groups
5 I need to create cohorts and add users on them
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | user1 | First | User | first@example.com |
11 | user2 | Second | User | second@example.com |
12 | user3 | Third | User | third@example.com |
13 | user4 | Forth | User | forth@example.com |
14 And I log in as "admin"
15 And I navigate to "Cohorts" node in "Site administration > Users > Accounts"
16 And I follow "Add new cohort"
17 And I set the following fields to these values:
18 | Name | Test cohort name |
21 | Description | Test cohort description |
22 And I press "Save changes"
25 Scenario: Add a cohort
26 When I follow "Cohorts"
27 Then I should see "Test cohort name"
28 And I should see "333"
29 And I should see "Test cohort description"
30 And I should see "Created manually"
33 Scenario: Add users to a cohort selecting them from the system users list
34 When I add "First User (first@example.com)" user to "333" cohort members
35 And I add "Second User (second@example.com)" user to "333" cohort members
36 Then I should see "2" in the "#cohorts" "css_element"
38 And the "Current users" select box should contain "First User (first@example.com)"
39 And the "Current users" select box should contain "Second User (second@example.com)"
40 And the "Current users" select box should not contain "Forth User (forth@example.com)"
43 Scenario: Add users to a cohort using a bulk user action
44 When I follow "Bulk user actions"
45 And I set the field "Available" to "Third User"
46 And I press "Add to selection"
47 And I set the field "Available" to "Forth User"
48 And I press "Add to selection"
49 And I set the field "id_action" to "Add to cohort"
51 And I set the field "Cohort" to "Test cohort name [333]"
52 And I press "Add to cohort"
53 And I follow "Cohorts"
54 Then I should see "2" in the "#cohorts" "css_element"
56 And the "Current users" select box should contain "Third User (third@example.com)"
57 And the "Current users" select box should contain "Forth User (forth@example.com)"
58 And the "Current users" select box should not contain "First User (first@example.com)"