[ Index ]

PHP Cross Reference of moodle-2.8

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 | [email protected] |
  14        | student0 | Student | 0 | [email protected] |
  15        | student1 | Student | 1 | [email protected] |
  16        | student2 | Student | 2 | [email protected] |
  17        | student3 | Student | 3 | [email protected] |
  18        | student4 | Student | 4 | [email protected] |
  19        | student5 | Student | 5 | [email protected] |
  20        | student6 | Student | 6 | [email protected] |
  21        | student7 | Student | 7 | [email protected] |
  22        | student8 | Student | 8 | [email protected] |
  23        | student9 | Student | 9 | [email protected] |
  24      And the following "course enrolments" exist:
  25        | user | course | role |
  26        | teacher1 | C1 | editingteacher |
  27        | student0 | C1 | student |
  28        | student1 | C1 | student |
  29        | student2 | C1 | student |
  30        | student3 | C1 | student |
  31        | student4 | C1 | student |
  32        | student5 | C1 | student |
  33        | student6 | C1 | student |
  34        | student7 | C1 | student |
  35        | student8 | C1 | student |
  36        | student9 | C1 | student |
  37      And I log in as "teacher1"
  38      And I follow "Course 1"
  39      And I expand "Users" node
  40      And I follow "Groups"
  41      When I press "Auto-create groups"
  42      And I expand all fieldsets
  43  
  44    @javascript
  45    Scenario: Split automatically the course users in groups and add the groups to a new grouping
  46      Given I set the following fields to these values:
  47        | Auto create based on | Number of groups |
  48        | Group/member count | 2 |
  49        | Grouping of auto-created groups | New grouping |
  50        | Grouping name | Grouping name |
  51      And I press "Preview"
  52      Then I should see "Group members"
  53      And I should see "User count"
  54      And I should see "Group A"
  55      And I should see "Group B"
  56      And I press "Submit"
  57      And the "groups" select box should contain "Group A (5)"
  58      And the "groups" select box should contain "Group B (5)"
  59      And I follow "Groupings"
  60      And I should see "Grouping name"
  61      And I click on "Show groups in grouping" "link" in the "Grouping name" "table_row"
  62      And the "removeselect" select box should contain "Group A"
  63      And the "removeselect" select box should contain "Group B"
  64  
  65    @javascript
  66    Scenario: Split automatically the course users in groups based on group member count
  67      Given I set the following fields to these values:
  68        | Auto create based on | Members per group |
  69        | Group/member count | 4 |
  70        | Grouping of auto-created groups | New grouping |
  71        | Grouping name | Grouping name |
  72      And I press "Preview"
  73      Then I should see "Group members"
  74      And I should see "User count"
  75      And I should see "Group A" in the ".generaltable" "css_element"
  76      And I should see "Group B" in the ".generaltable" "css_element"
  77      And I should see "Group C" in the ".generaltable" "css_element"
  78      And I should see "4" in the "Group A" "table_row"
  79      And I should see "4" in the "Group B" "table_row"
  80      And I should see "2" in the "Group C" "table_row"
  81      And I set the field "Prevent last small group" to "1"
  82      And I press "Preview"
  83      And I should see "Group A" in the ".generaltable" "css_element"
  84      And I should see "Group B" in the ".generaltable" "css_element"
  85      And I should see "5" in the "Group A" "table_row"
  86      And I should see "5" in the "Group B" "table_row"
  87  
  88    @javascript
  89    Scenario: Split automatically the course users in groups that are not in groups
  90      Given I press "Cancel"
  91      And I press "Create group"
  92      And I set the following fields to these values:
  93        | Group name | Group 1 |
  94      And I press "Save changes"
  95      And I press "Create group"
  96      And I set the following fields to these values:
  97        | Group name | Group 2 |
  98      And I press "Save changes"
  99      When I add "Student 0" user to "Group 1" group members
 100      And I add "Student 1" user to "Group 1" group members
 101      And I add "Student 2" user to "Group 2" group members
 102      And I add "Student 3" user to "Group 2" group members
 103      And I press "Auto-create groups"
 104      And I expand all fieldsets
 105      And I set the field "Auto create based on" to "Number of groups"
 106      And I set the field "Group/member count" to "2"
 107      And I set the field "Grouping of auto-created groups" to "No grouping"
 108      And I set the field "Ignore users in groups" to "1"
 109      And I press "Submit"
 110      And the "groups" select box should contain "Group A (3)"
 111      And the "groups" select box should contain "Group B (3)"
 112  
 113    @javascript
 114    Scenario: Split users into groups based on existing groups or groupings
 115      Given I set the following fields to these values:
 116        | Naming scheme | Group @ |
 117        | Auto create based on | Number of groups |
 118        | Group/member count | 2 |
 119        | Grouping of auto-created groups | No grouping |
 120      And I press "Submit"
 121      And I press "Auto-create groups"
 122      And I set the following fields to these values:
 123        | Naming scheme | Test @ |
 124        | Auto create based on | Number of groups |
 125        | Group/member count | 2 |
 126        | groupid | Group A |
 127        | Grouping of auto-created groups | New grouping |
 128        | Grouping name | Sub Grouping |
 129      And I press "Submit"
 130      And the "groups" select box should contain "Test A (3)"
 131      And the "groups" select box should contain "Test B (2)"
 132      And I press "Auto-create groups"
 133      And I set the following fields to these values:
 134        | Naming scheme | Test # |
 135        | Auto create based on | Number of groups |
 136        | Group/member count | 2 |
 137        | Select members from grouping | Sub Grouping |
 138        | Grouping of auto-created groups | No grouping |
 139      And I press "Submit"
 140      And the "groups" select box should contain "Test 1 (3)"
 141      And the "groups" select box should contain "Test 2 (2)"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1