Skip to content

Commit

Permalink
Merge branch 'MDL-38620_master' of git://github.com/dmonllao/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Apr 2, 2013
2 parents 1287941 + e62f1b3 commit 3e27548
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 17 deletions.
46 changes: 46 additions & 0 deletions admin/tests/behat/upload_users.feature
@@ -0,0 +1,46 @@
@admin @_only_local
Feature: Upload users
In order to add users to the system
As a moodle admin
I need to upload files containing the users data

@javascript
Scenario: Upload users enrolling them on courses and groups
Given the following "courses" exists:
| fullname | shortname | category |
| Maths | math102 | 0 |
And the following "groups" exists:
| name | course | idnumber |
| Section 1 | math102 | S1 |
| Section 3 | math102 | S3 |
And I log in as "admin"
And I expand "Front page settings" node
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
And I follow "Upload users"
When I upload "lib/tests/fixtures/upload_users.csv" file to "File" filepicker
And I press "Upload users"
Then I should see "Upload users preview"
And I should see "Tom"
And I should see "Jones"
And I should see "verysecret"
And I should see "jonest@someplace.edu"
And I should see "Reznor"
And I should see "course1"
And I should see "math102"
And I should see "group1"
And I should see "Section 1"
And I press "Upload users"
And I press "Continue"
And I follow "Browse list of users"
And I should see "Tom Jones"
And I should see "Trent Reznor"
And I should see "reznor@someplace.edu"
And I am on homepage
And I follow "Maths"
And I expand "Users" node
And I follow "Groups"
And I select "Section 1 (1)" from "groups"
And I wait "4" seconds
And the "members" select box should contain "Tom Jones"
5 changes: 3 additions & 2 deletions lib/tests/fixtures/upload_users.csv
@@ -1,2 +1,3 @@
username,password,email,firstname,lastname
teacher1,moodle,teacher1@teacher1.com,Teacher,1
username,password,firstname,lastname,email,course1,group1
jonest,verysecret,Tom,Jones,jonest@someplace.edu,math102,Section 1
reznor,somesecret,Trent,Reznor,reznor@someplace.edu,math102,Section 3
15 changes: 0 additions & 15 deletions repository/upload/tests/behat/upload_file.feature
Expand Up @@ -4,21 +4,6 @@ Feature: Upload files
As a moodle user
I need to upload files

@javascript
Scenario: Upload a file in a single file filepicker
Given I log in as "admin"
And I expand "Front page settings" node
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
And I follow "Upload users"
When I upload "lib/tests/fixtures/upload_users.csv" file to "File" filepicker
And I press "Upload users"
Then I should see "Upload users preview"
And I should see "Teacher"
And I should see "teacher1@teacher1.com"
And I press "Cancel"

@javascript
Scenario: Upload a file in a multiple file filepicker
Given the following "courses" exists:
Expand Down

0 comments on commit 3e27548

Please sign in to comment.