[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 @core @core_group @_file_upload 2 Feature: Importing of groups and groupings 3 In order to import groups and grouping 4 As a teacher 5 I need to upload a file and verify groups and groupings can be imported 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 And the following "course enrolments" exist: 15 | user | course | role | 16 | teacher1 | C1 | editingteacher | 17 18 @javascript 19 Scenario: Import groups and groupings as teacher 20 Given I log in as "teacher1" 21 And I follow "Course 1" 22 And I expand "Users" node 23 And I follow "Groups" 24 And I press "Import groups" 25 When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filemanager 26 And I press "Import groups" 27 And I press "Continue" 28 Then I should see "group-id-1" 29 And I should see "group-id-2" 30 And I should see "group-id-1-duplicate" 31 And I should see "group-noid-1" 32 And I should see "group-noid-2" 33 And I follow "Groupings" 34 And I should see "Grouping-1" 35 And I should see "Grouping-2" 36 And I should see "Grouping-3" 37 And I should see "group-id-1" in the "Grouping-1" "table_row" 38 And I should see "group-id-2" in the "Grouping-2" "table_row" 39 And I should see "group-noid-2" in the "Grouping-2" "table_row" 40 And I should see "group-id-1-duplicate" in the "Grouping-3" "table_row" 41 And I should see "group-noid-1" in the "Grouping-3" "table_row" 42 43 @javascript 44 Scenario: Import groups with idnumber when the user has proper permissions for the idnumber field 45 Given I log in as "teacher1" 46 And I follow "Course 1" 47 And I expand "Users" node 48 And I follow "Groups" 49 And I press "Import groups" 50 When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filemanager 51 And I press "Import groups" 52 Then I should see "Group group-id-1 added successfully" 53 And I should see "Group group-id-2 added successfully" 54 And I should see "group-id-1-duplicate: Group \"group-id-1\" with an idnumber of \"group-id-1\" already exists for this course" 55 And I should see "Group group-id-1-duplicate added successfully" 56 And I should see "Group group-noid-1 added successfully" 57 And I should see "Group group-noid-2 added successfully" 58 And I press "Continue" 59 And I set the field "groups" to "group-id-1" 60 And I press "Edit group settings" 61 And the field "id_idnumber" matches value "group-id-1" 62 And I press "Cancel" 63 And I set the field "groups" to "group-id-2" 64 And I press "Edit group settings" 65 And the field "id_idnumber" matches value "group-id-2" 66 And I press "Cancel" 67 And I set the field "groups" to "group-id-1-duplicate" 68 And I press "Edit group settings" 69 And the field "id_idnumber" matches value "" 70 And I press "Cancel" 71 And I set the field "groups" to "group-noid-1" 72 And I press "Edit group settings" 73 And the field "id_idnumber" matches value "" 74 And I press "Cancel" 75 And I set the field "groups" to "group-noid-2" 76 And I press "Edit group settings" 77 And the field "id_idnumber" matches value "" 78 And I press "Cancel" 79 80 @javascript 81 Scenario: Import groups with idnumber when the user does not have proper permissions for the idnumber field 82 Given I log in as "admin" 83 And I follow "Course 1" 84 And I expand "Users" node 85 And I follow "Permissions" 86 And I override the system permissions of "Teacher" role with: 87 | moodle/course:changeidnumber | Prevent | 88 And I log out 89 And I log in as "teacher1" 90 And I follow "Course 1" 91 And I expand "Users" node 92 And I follow "Groups" 93 And I press "Import groups" 94 When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filemanager 95 And I press "Import groups" 96 And I press "Continue" 97 Then I set the field "groups" to "group-id-1" 98 And I press "Edit group settings" 99 And the field "id_idnumber" matches value "" 100 And I press "Cancel" 101 And I set the field "groups" to "group-id-2" 102 And I press "Edit group settings" 103 And the field "id_idnumber" matches value "" 104 And I press "Cancel" 105 And I set the field "groups" to "group-id-1-duplicate" 106 And I press "Edit group settings" 107 And the field "id_idnumber" matches value "" 108 And I press "Cancel" 109 And I set the field "groups" to "group-noid-1" 110 And I press "Edit group settings" 111 And the field "id_idnumber" matches value "" 112 And I press "Cancel" 113 And I set the field "groups" to "group-noid-2" 114 And I press "Edit group settings" 115 And the field "id_idnumber" matches value "" 116 And I press "Cancel"
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |