[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/group/tests/behat/ -> auto_creation.feature (source)

   1  @core @core_group
   2  Feature: Automatic creation of groups
   3    In order to quickly create groups
   4    As a teacher
   5    I need to create groups automatically and allocate them in groupings if necessary
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname | category |
  10        | Course 1 | C1 | 0 |
  11      And the following "users" exist:
  12        | username | firstname | lastname | email |
  13        | teacher1 | Teacher | 1 | teacher1@example.com |
  14        | student1 | Student | 1 | student1@example.com |
  15        | student2 | Student | 2 | student2@example.com |
  16        | student3 | Student | 3 | student3@example.com |
  17        | student4 | Student | 4 | student4@example.com |
  18        | student5 | Student | 5 | student5@example.com |
  19        | student6 | Student | 6 | student6@example.com |
  20        | student7 | Student | 7 | student7@example.com |
  21        | student8 | Student | 8 | student8@example.com |
  22        | student9 | Student | 9 | student9@example.com |
  23        | student10 | Student | 10 | student10@example.com |
  24        | suspendedstudent11 | Suspended student | 11 | suspendedstudent11@example.com |
  25      And the following "course enrolments" exist:
  26        | user | course | role | status |
  27        | teacher1 | C1 | editingteacher | 0 |
  28        | student1 | C1 | student | 0 |
  29        | student2 | C1 | student | 0 |
  30        | student3 | C1 | student | 0 |
  31        | student4 | C1 | student | 0 |
  32        | student5 | C1 | student | 0 |
  33        | student6 | C1 | student | 0 |
  34        | student7 | C1 | student | 0 |
  35        | student8 | C1 | student | 0 |
  36        | student9 | C1 | student | 0 |
  37        | student10 | C1 | student | 0 |
  38        | suspendedstudent11 | C1 | student | 1 |
  39      And I log in as "teacher1"
  40      And I follow "Course 1"
  41      And I expand "Users" node
  42      And I follow "Groups"
  43      When I press "Auto-create groups"
  44      And I expand all fieldsets
  45  
  46    @javascript
  47    Scenario: Split automatically the course users in groups and add the groups to a new grouping
  48      Given I set the following fields to these values:
  49        | Auto create based on | Number of groups |
  50        | Group/member count | 2 |
  51        | Grouping of auto-created groups | New grouping |
  52        | Grouping name | Grouping name |
  53      And I press "Preview"
  54      Then I should see "Group members"
  55      And I should see "User count"
  56      And I should see "Group A"
  57      And I should see "Group B"
  58      And I press "Submit"
  59      And the "groups" select box should contain "Group A (5)"
  60      And the "groups" select box should contain "Group B (5)"
  61      And I follow "Groupings"
  62      And I should see "Grouping name"
  63      And I click on "Show groups in grouping" "link" in the "Grouping name" "table_row"
  64      And the "removeselect" select box should contain "Group A"
  65      And the "removeselect" select box should contain "Group B"
  66  
  67    @javascript
  68    Scenario: Split automatically the course users in groups based on group member count
  69      Given I set the following fields to these values:
  70        | Auto create based on | Members per group |
  71        | Group/member count | 4 |
  72        | Grouping of auto-created groups | New grouping |
  73        | Grouping name | Grouping name |
  74      And I press "Preview"
  75      Then I should see "Group members"
  76      And I should see "User count"
  77      And I should see "Group A" in the ".generaltable" "css_element"
  78      And I should see "Group B" in the ".generaltable" "css_element"
  79      And I should see "Group C" in the ".generaltable" "css_element"
  80      And I should see "4" in the "Group A" "table_row"
  81      And I should see "4" in the "Group B" "table_row"
  82      And I should see "2" in the "Group C" "table_row"
  83      And I set the field "Prevent last small group" to "1"
  84      And I press "Preview"
  85      And I should see "Group A" in the ".generaltable" "css_element"
  86      And I should see "Group B" in the ".generaltable" "css_element"
  87      And I should see "5" in the "Group A" "table_row"
  88      And I should see "5" in the "Group B" "table_row"
  89  
  90    @javascript
  91    Scenario: Split automatically the course users in groups that are not in groups
  92      Given I press "Cancel"
  93      And I press "Create group"
  94      And I set the following fields to these values:
  95        | Group name | Group 1 |
  96      And I press "Save changes"
  97      And I press "Create group"
  98      And I set the following fields to these values:
  99        | Group name | Group 2 |
 100      And I press "Save changes"
 101      When I add "Student 1" user to "Group 1" group members
 102      And I add "Student 2" user to "Group 1" group members
 103      And I add "Student 3" user to "Group 2" group members
 104      And I add "Student 4" user to "Group 2" group members
 105      And I press "Auto-create groups"
 106      And I expand all fieldsets
 107      And I set the field "Auto create based on" to "Number of groups"
 108      And I set the field "Group/member count" to "2"
 109      And I set the field "Grouping of auto-created groups" to "No grouping"
 110      And I set the field "Ignore users in groups" to "1"
 111      And I press "Submit"
 112      And the "groups" select box should contain "Group A (3)"
 113      And the "groups" select box should contain "Group B (3)"
 114  
 115    @javascript
 116    Scenario: Split users into groups based on existing groups or groupings
 117      Given I set the following fields to these values:
 118        | Naming scheme | Group @ |
 119        | Auto create based on | Number of groups |
 120        | Group/member count | 2 |
 121        | Grouping of auto-created groups | No grouping |
 122      And I press "Submit"
 123      And I press "Auto-create groups"
 124      And I set the following fields to these values:
 125        | Naming scheme | Test @ |
 126        | Auto create based on | Number of groups |
 127        | Group/member count | 2 |
 128        | groupid | Group A |
 129        | Grouping of auto-created groups | New grouping |
 130        | Grouping name | Sub Grouping |
 131      And I press "Submit"
 132      And the "groups" select box should contain "Test A (3)"
 133      And the "groups" select box should contain "Test B (2)"
 134      And I press "Auto-create groups"
 135      And I set the following fields to these values:
 136        | Naming scheme | Test # |
 137        | Auto create based on | Number of groups |
 138        | Group/member count | 2 |
 139        | Select members from grouping | Sub Grouping |
 140        | Grouping of auto-created groups | No grouping |
 141      And I press "Submit"
 142      And the "groups" select box should contain "Test 1 (3)"
 143      And the "groups" select box should contain "Test 2 (2)"
 144  
 145    Scenario: Exclude suspended users when auto-creating groups
 146      Given I set the field "Include only active enrolments" to "1"
 147      And I set the field "Auto create based on" to "Members per group"
 148      When I set the field "Group/member count" to "11"
 149      And I press "Preview"
 150      Then I should not see "Suspended Student 11"
 151  
 152    Scenario: Include suspended users when auto-creating groups
 153      Given I set the field "Include only active enrolments" to "0"
 154      And I set the field "Auto create based on" to "Members per group"
 155      When I set the field "Group/member count" to "11"
 156      And I press "Preview"
 157      Then I should see "Suspended student 11"
 158  
 159    Scenario: Do not display 'Include only active enrolments' if user does not have the 'moodle/course:viewsuspendedusers' capability
 160      Given I log out
 161      And I log in as "admin"
 162      And I set the following system permissions of "Teacher" role:
 163        | capability | permission |
 164        | moodle/course:viewsuspendedusers | Prevent |
 165      And I log out
 166      And I log in as "teacher1"
 167      And I follow "Course 1"
 168      And I expand "Users" node
 169      And I follow "Groups"
 170      When I press "Auto-create groups"
 171      Then I should not see "Include only active enrolments"
 172      And I set the field "Group/member count" to "11"
 173      And I press "Preview"
 174      And I should not see "Suspended Student 11"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1