AutorÃa | Ultima modificación | Ver Log |
@tool @tool_uploaduser @_file_uploadFeature: Upload usersIn order to add users to the systemAs an adminI need to upload files containing the users data@javascriptScenario: Upload users enrolling them on courses and groupsGiven the following "courses" exist:| fullname | shortname | category || Maths | math102 | 0 |And the following "groups" exist:| name | course | idnumber || Section 1 | math102 | S1 || Section 3 | math102 | S3 |And I log in as "admin"And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users.csv" file to "File" filemanagerAnd 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@example.com"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 navigate to "Users > Accounts > Browse list of users" in site administrationAnd I should see "Tom Jones"And I should see "Trent Reznor"And I should see "reznor@example.com"And I am on the "Maths" "groups" pageAnd I set the field "groups" to "Section 1 (1)"And the "members" select box should contain "Tom Jones (jonest@example.com)"@javascriptScenario: Upload users enrolling them on courses and groups applying defaultsGiven the following "courses" exist:| fullname | shortname | category || Maths | math102 | 0 |And the following "groups" exist:| name | course | idnumber || Section 1 | math102 | S1 || Section 3 | math102 | S3 |And I log in as "admin"And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users.csv" file to "File" filemanagerAnd I press "Upload users"And I should see "Upload users preview"And I set the following fields to these values:| City/town | Brighton || Department | Purchasing |And I press "Upload users"And I press "Continue"And I navigate to "Users > Accounts > Browse list of users" in site administrationAnd I should see "Tom Jones"And I follow "Tom Jones"And I follow "Edit profile"And the field "City/town" matches value "Brighton"And the field "Department" matches value "Purchasing"@javascriptScenario: Upload users with custom profile fields# Create user profile field.Given the following "custom profile fields" exist:| datatype | shortname | name || text | superfield | Super field |And I log in as "admin"# Upload users.When I navigate to "Users > Accounts > Upload users" in site administrationAnd I upload "lib/tests/fixtures/upload_users_profile.csv" file to "File" filemanagerAnd I press "Upload users"And I should see "Upload users preview"And I press "Upload users"# Check that users were created and the superfield is filled.And I navigate to "Users > Accounts > Browse list of users" in site administrationAnd I follow "Tom Jones"And I should see "Super field"And I should see "The big guy"And I log out@javascriptScenario: Upload users setting their email stop valueGiven I log in as "admin"And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users_emailstop.csv" file to "File" filemanagerAnd I press "Upload users"Then I should see "Upload users preview"And the following should exist in the "uupreview" table:| CSV line | username | emailstop || 2 | jbloggs | 1 || 3 | fbloggs | 0 |And I press "Upload users"And I should see "Users created: 2"And I log out@javascriptScenario: Upload users setting their user themeGiven the following "courses" exist:| fullname | shortname | category || Maths | math102 | 0 |# We need to do a bit of setup here.And I change window size to "large"And I log in as "admin"And I navigate to "Security > Site security settings" in site administrationAnd I click on "Password policy" "checkbox"And I click on "Save changes" "button"And I navigate to "Appearance > Advanced theme settings" in site administrationAnd I click on "Allow user themes" "checkbox"And I click on "Save changes" "button"# Upload the users.And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users_themes.csv" file to "File" filemanagerAnd I press "Upload users"Then I should see "Upload users preview"And I should see "boost"And I should see "classic"And I should see "No theme is defined for this user."And I should see "Theme \"somefaketheme\" is not installed and will be ignored."And I press "Upload users"And I should see "Users created: 4"And I press "Continue"# Boost check.And I am on the "jonest@example.com" "user > editing" pageAnd I should see "Boost"# Classic check.And I am on the "reznor@example.com" "user > editing" pageAnd I should see "Classic"@javascriptScenario: Upload users setting their user theme when allowuserthemes is falseGiven the following "courses" exist:| fullname | shortname | category || Maths | math102 | 0 |# We need to do a bit of setup here.And I change window size to "large"And I log in as "admin"And I navigate to "Security > Site security settings" in site administrationAnd I click on "Password policy" "checkbox"And I click on "Save changes" "button"# Upload the users.And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users_themes.csv" file to "File" filemanagerAnd I press "Upload users"Then I should see "Upload users preview"And I should see "boost"And I should see "classic"And I press "Upload users"And I should see "User themes are not enabled, so any included in the upload users file will be ignored."And I should see "Users created: 4"And I press "Continue"And I log out@javascriptScenario: Upload users setting their enrol date and periodGiven the following "courses" exist:| fullname | shortname | category || Maths | math102 | 0 |# Upload the users.And I change window size to "large"And I log in as "admin"And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users_enrol_date_period.csv" file to "File" filemanagerAnd I press "Upload users"Then I should see "Upload users preview"And I press "Upload users"# Check user enrolment start date and periodAnd I am on "Maths" course homepageThen I navigate to course participantsAnd I click on "Manual enrolments" "link" in the "Student One" "table_row"Then I should see "1 January 2019" in the "Enrolment starts" "table_row"And I should not see "Enrolment ends"And I click on "Close" "button" in the "Enrolment details" "dialogue"And I click on "Manual enrolments" "link" in the "Student Two" "table_row"Then I should see "2 January 2020" in the "Enrolment starts" "table_row"And I should see "12 January 2020" in the "Enrolment ends" "table_row"And I click on "Close" "button" in the "Enrolment details" "dialogue"And I log out@javascriptScenario: Upload users enrolling them on courses and assign category rolesGiven the following "courses" exist:| fullname | shortname || management1 | management1 || film1 | film1 |And the following "categories" exist:| name | idnumber || MGMT | MGMT || Film | Film |And I log in as "admin"And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users_category.csv" file to "File" filemanagerAnd 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 "Trent"And I should see "Reznor"And I should see "Aurora"And I should see "Jiang"And I should see "Federico"And I should see "Fellini"And I should see "Ivan"And I should see "Ivanov"And I should see "John"And I should see "Smith"And I should see "Warm"And I should see "Cool"And I should see "James"And I should see "Bond"And I should see "MGMT"And I should see "Film"And I should see "manager"And I should see "student"And I should see "coursecreator"And I should see "management1"And I should see "film1"And I press "Upload users"And I should see "Unknown category with category ID number \"Movie\""And I should see "Unknown course named \"movie1\""And I should see "Unknown role \"notcoursecreator\""And I should see "Could not assign role to user: missing role for category"And I press "Continue"And I navigate to "Users > Accounts > Browse list of users" in site administrationAnd I should see "Tom Jones"And I should see "Trent Reznor"And I should see "reznor@example.com"And I am on the "management1" "enrolled users" pageAnd I should see "Tom Jones"And I should see "Trent Reznor"And I should see "Aurora Jiang"And I should see "Student"And I am on the "film1" "enrolled users" pageAnd I should see "Federico Fellini"And I should see "Student"And I am on site homepageAnd I navigate to "Courses > Manage courses and categories" in site administrationAnd I click on "permissions" action for "MGMT" in management category listingAnd I set the field "Participants tertiary navigation" to "Assign roles"And I should see "Manager"And I should see "Tom Jones"And I should see "Trent Reznor"And I should see "Course creator"And I should see "Aurora Jiang"And I am on site homepageAnd I navigate to "Courses > Manage courses and categories" in site administrationAnd I click on "permissions" action for "Film" in management category listingAnd I set the field "Participants tertiary navigation" to "Assign roles"And I should see "Course creator"And I should see "Federico Fellini"@javascriptScenario: Update existing users matching them on emailGiven the following "users" exist:| username | firstname | lastname | email || bilbob | Blasbo | Blabbins | bilbo@example.com || frodob | Frodeo | Baspins | frodo@example.com |And I log in as "admin"And I navigate to "Users > Accounts >Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users_email_matching.csv" file to "File" filemanagerAnd I press "Upload users"Then I should see "Upload users preview"And I set the following fields to these values:| Upload type | Update existing users only || Existing user details | Override with file || Match on email address | Yes |And I press "Upload users"And I press "Continue"And I navigate to "Users > Accounts > Browse list of users" in site administrationAnd I should see "Bilbo Baggins"And I should see "Frodo Baggins"@javascriptScenario: Update existing users matching them on email where one email address is associated with multiple usersGiven the following "users" exist:| username | firstname | lastname | email || bilbob | Blasbo | Blabbins | bilbo@example.com || frodob | Frodeo | Baspins | frodo@example.com || fredob | Fredoo | Baspins | frodo@example.com |And I log in as "admin"And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users_email_matching.csv" file to "File" filemanagerAnd I press "Upload users"Then I should see "Upload users preview"And I set the following fields to these values:| Upload type | Update existing users only || Existing user details | Override with file || Match on email address | Yes |And I press "Upload users"And I should see "Multiple users with email frodo@example.com detected"And I press "Continue"And I navigate to "Users > Accounts > Browse list of users" in site administrationAnd I should see "Bilbo Baggins"And I should not see "Frodo Baggins"@javascriptScenario: Create a new user when matching them on email where where the username already existsGiven the following "users" exist:| username | firstname | lastname | email || bilbob | Samwise | Gamgee | samwise@example.com || frodob | Frodeo | Baspins | frodo@example.com |And I log in as "admin"And I navigate to "Users > Accounts > Upload users" in site administrationWhen I upload "lib/tests/fixtures/upload_users_email_matching.csv" file to "File" filemanagerAnd I press "Upload users"Then I should see "Upload users preview"And I set the following fields to these values:| Upload type | Add new and update existing users || Existing user details | Override with file || Match on email address | Yes |And I press "Upload users"And I should see "User not added - username already exists under a different email"And I press "Continue"And I navigate to "Users > Accounts > Browse list of users" in site administrationAnd I should see "Samwise Gamgee"And I should see "Frodo Baggins"