Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_cohort
2
Feature: Add cohorts of users
3
  In order to create site-wide groups
4
  As an admin
5
  I need to create cohorts and add users on them
6
 
7
  Background:
8
    Given the following "custom profile fields" exist:
9
      | datatype | shortname | name  |
10
      | text     | fruit     | Fruit |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email              | profile_field_fruit |
13
      | user1    | First     | User     | first@example.com  | Apple               |
14
      | user2    | Second    | User     | second@example.com | Banana              |
15
      | user3    | Third     | User     | third@example.com  | Apple               |
16
      | user4    | Forth     | User     | forth@example.com  | Pear                |
17
    And the following "cohort" exists:
18
      | name        | Test cohort name        |
19
      | idnumber    | 333                     |
20
      | description | Test cohort description |
21
    And I log in as "admin"
22
    And I navigate to "Users > Accounts > Cohorts" in site administration
23
 
24
  @javascript
25
  Scenario: Add a cohort
26
    When I follow "Add new cohort"
27
    And I set the following fields to these values:
28
      | Name        | My new cohort         |
29
      | Context     | System                |
30
      | Cohort ID   | mynewcohort           |
31
      | Description | My new cohort is cool |
32
    And I press "Save changes"
33
    Then the following should exist in the "generaltable" table:
34
      | Name          | Cohort ID   | Description           |
35
      | My new cohort | mynewcohort | My new cohort is cool |
36
    And I should see "Test cohort name"
37
    And I should see "333"
38
    And I should see "Test cohort description"
39
    And I should see "Created manually"
40
 
41
  @javascript
42
  Scenario: Add users to a cohort selecting them from the system users list
43
    When I add "First User (first@example.com)" user to "333" cohort members
44
    And I add "Second User (second@example.com)" user to "333" cohort members
45
    Then the following should exist in the "reportbuilder-table" table:
46
      | Name              | Cohort size  |
47
      | Test cohort name  | 2            |
48
    And I press "Assign" action in the "Test cohort name" report row
49
    And the "Current users" select box should contain "First User (first@example.com)"
50
    And the "Current users" select box should contain "Second User (second@example.com)"
51
    And the "Current users" select box should not contain "Forth User (forth@example.com)"
52
 
53
  @javascript
54
  Scenario: Add user to cohort using custom user field search
55
    Given the following config values are set as admin:
56
      | showuseridentity | email,profile_field_fruit |
57
    When I press "Assign" action in the "Test cohort name" report row
58
    And I set the field "addselect_searchtext" to "Apple"
59
    And I wait "1" seconds
60
    Then the "Potential users" select box should contain "First User (first@example.com\, Apple)"
61
    And the "Potential users" select box should not contain "Second User (second@example.com\, Banana)"
62
    And the "Potential users" select box should not contain "Forth User (forth@example.com\, Pear)"
63
    And I set the field "Potential users" to "Third User (third@example.com\, Apple)"
64
    And I press "Add"
65
    And the "Current users" select box should contain "Third User (third@example.com\, Apple)"
66
 
67
  @javascript
68
  Scenario: Remove user from cohort using custom user field search
69
    Given the following config values are set as admin:
70
      | showuseridentity | email,profile_field_fruit |
71
    And the following "cohort members" exist:
72
      | cohort | user  |
73
      | 333    | user1 |
74
      | 333    | user2 |
75
    When I press "Assign" action in the "Test cohort name" report row
76
    And I set the field "removeselect_searchtext" to "Apple"
77
    And I wait "1" seconds
78
    Then the "Current users" select box should not contain "Second User (second@example.com\, Banana)"
79
    And I set the field "Current users" to "First User (first@example.com\, Apple)"
80
    And I press "Remove"
81
    And the "Potential users" select box should contain "First User (first@example.com\, Apple)"
82
 
83
  @javascript
84
  Scenario: Add users to a cohort using a bulk user action
85
    When I navigate to "Users > Accounts > Bulk user actions" in site administration
86
    And I set the field "Available" to "Third User"
87
    And I press "Add to selection"
88
    And I set the field "Available" to "Forth User"
89
    And I press "Add to selection"
90
    And I set the field "id_action" to "Add to cohort"
91
    And I press "Go"
92
    And I set the field "Cohort" to "Test cohort name [333]"
93
    And I press "Add to cohort"
94
    And I navigate to "Users > Accounts > Cohorts" in site administration
95
    Then the following should exist in the "reportbuilder-table" table:
96
      | Name              | Cohort size  |
97
      | Test cohort name  | 2            |
98
    And I press "Assign" action in the "Test cohort name" report row
99
    And the "Current users" select box should contain "Third User (third@example.com)"
100
    And the "Current users" select box should contain "Forth User (forth@example.com)"
101
    And the "Current users" select box should not contain "First User (first@example.com)"
102
 
103
  @javascript
104
  Scenario: Add users to a cohort using a user list bulk action
105
    When I navigate to "Users > Accounts > Browse list of users" in site administration
106
    And I click on "Third User" "checkbox"
107
    And I click on "Forth User" "checkbox"
108
    And I set the field "Bulk user actions" to "Add to cohort"
109
    And I set the field "Cohort" to "Test cohort name [333]"
110
    And I press "Add to cohort"
111
    And I should see "Browse list of users"
112
    And I navigate to "Users > Accounts > Cohorts" in site administration
113
    Then the following should exist in the "reportbuilder-table" table:
114
      | Name              | Cohort size  |
115
      | Test cohort name  | 2            |
116
    And I press "Assign" action in the "Test cohort name" report row
117
    And the "Current users" select box should contain "Third User (third@example.com)"
118
    And the "Current users" select box should contain "Forth User (forth@example.com)"
119
    And the "Current users" select box should not contain "First User (first@example.com)"
120
 
121
  @javascript
122
  Scenario: Edit cohort name in-place
123
    When I navigate to "Users > Accounts > Cohorts" in site administration
124
    And I set the field "Edit cohort name" to "Students cohort"
125
    Then I should not see "Test cohort name"
126
    And I should see "Students cohort"
127
    And I navigate to "Users > Accounts > Cohorts" in site administration
128
    And I should see "Students cohort"