Commit 5dd3b1ae authored by Rebecca Blundell's avatar Rebecca Blundell
Browse files

Bug #1703721 - combine add user tests and make more comprehensive

Removes 3 existing tests and replaces with one Adds 2 new csv files
-fixed domain names so they are all example.org
-changed one domain to example.com for use in add_users_new test
as mahara doesn't like .org.
Indentation and Captalisation changes done.

Change-Id: I0c767c5736c613d3d82b20a59014015db8ea6071
parent 3bf14023
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@javascript @core @core_administration
Feature: Configuration changes on add users page
In order to change configuration settings on the add users page
As an admin
So I can benefit from the use of different configuration changes

Scenario: Turning switches on and off on the Add user page (Bug 1431569)
 Given I log in as "admin" with password "Kupuhipa1"
 And I choose "Add user" in "Users" from administration menu
 And I set the following fields to these values:
 | Site staff | 1 |
 | Site administrator | 1 |
 | Institution administrator | 1 |
 And I press "Create user"
 # Checking that the page will require you to fill more fields in before you hit save
 And I should see "There was an error with submitting this form. Please check the marked fields and try again."
+0 −27
Original line number Diff line number Diff line
@javascript @core @core_administration
Feature: Allow user csv upload to ignore non-essential mandatory fields
    In order to add users by csv
    As an admin follow through add users by csv
    So I can change the mandatory fields

Scenario: Create users by csv (Bug 1426983)
    # Log in as "Admin" user
    Given I log in as "admin" with password "Kupuhipa1"
    # Verifying log in was successful
    And I should see "Admin User"
    # Adding Users by CVS
    And I choose "Add users by CSV" in "Users" from administration menu
    And I attach the file "UserCSV.csv" to "CSV file"
    And I disable the switch "Force password change"
    And I disable the switch "Email users about their account"
    And I press "Add users by CSV"
    Then I should see "Your CSV file was processed successfully"
    And I should see "New users added: 4."

    # Check that we can delete a user after upload (Bug #1558864)
    And I choose "User search" in "Users" from administration menu
    And I follow "kevin01"
    And I follow "Suspend or delete this user"
    And I scroll to the id "delete"
    And I press and confirm "Delete user"
    And I should see "User deleted successfully"
+104 −0
Original line number Diff line number Diff line
@javascript @core @core_administration
Feature: Configuration changes on add users page
In order to change configuration settings on the add users page
As an admin
So I can benefit from the use of different configuration changes

Background:
  Given the following "institutions" exist:
  | name | displayname | registerallowed | registerconfirm |
  | instone | Institution One | ON | OFF |
  | insttwo | Institution Two | ON | OFF |

  And the following "users" exist:
  | username | password | email | firstname | lastname | institution | authname | role |
  | StaffA | Kupuhipa1 | StaffA@example.com | Alexei | Staff | instone | internal | staff |

 Scenario: Admin to add an user (Bug 1703721)
  Given I log in as "admin" with password "Kupuhipa1"
  And I choose "Add user" in "Users" from administration menu
  And I set the following fields to these values:
  | First name | Bob |
  | Last name | One |
  | Email | UserB@example.com |
  | Username | instadmin |
  | password | Kupuhipa1 |
  | Institution administrator | 1 |
  And I select "Institution One" from "adduser_authinstance"
  And I press "General account options"
  And I set the following fields to these values:
  | Multiple journals | 1 |
  And I press "×" in the "div.modal-header" "css_element"
  And I press "Create user"
  Then I should see "New user account created successfully"
  And I expand "Institution settings - Institution One" node
  And the field "Institution administrator" matches value "1"
 #Login as Institution admin
  And I should see "Log in as this user"
  And I scroll to the top
  And I follow "Log in as this user"
  And I should see "You are required to change your password before you can proceed."
  And I follow "log in anyway"
  And I choose "Users" from administration menu
  And I follow "Bob"
  And I wait "1" seconds
  And I should see "Administrator of Institution One"
  And I click on "Show administration menu"
  And I should see "Groups" in the "#main-nav-admin" "css_element"
  And I should not see "Extensions" in the "#main-nav-admin" "css_element"
 #Checking  multiple journals
  And I choose "Journals" in "Content" from main menu
  And I should see "Create journal"
  And I log out
 #login as staff user
  Given I log in as "StaffA" with password "Kupuhipa1"
  And I click on "Show administration menu"
  And I should see "Reports" in the "#main-nav-admin" "css_element"
  And I should not see "Groups" in the "#main-nav-admin" "css_element"
 #Site admin role already tested in menu_navigation.feature file

Scenario: Create users by csv (Bug 1426983)
  Given I log in as "admin" with password "Kupuhipa1"
 #Verifying log in was successful
  And I should see "Admin User"
 #Adding 50 Users by csv
  And I choose "Add users by CSV" in "Users" from administration menu
  And I attach the file "50users_new.csv" to "CSV file"
  And I select "Institution One" from "uploadcsv_authinstance"
  And I press "Add users by CSV"
  Then I should see "Your CSV file was processed successfully"
  And I should see "New users added: 50."
 #Upload 20 users by csv by choosing the switch update users
  And I choose "Add users by CSV" in "Users" from administration menu
  And I attach the file "20users_update.csv" to "CSV file"
  And I select "Institution One" from "uploadcsv_authinstance"
  And I enable the switch "Update users"
  And I press "Add users by CSV"
  Then I should see "Your CSV file was processed successfully"
  And I should see "Users updated: 20."
  And I log out
 #Check that we update the fields, password change and email recieved
  Given I log in as "user0005" with password "changeme3"
  And I should see "You are required to change your password before you can proceed."
  And I fill in "New password" with "dragon123"
  And I fill in "Confirm password" with "dragon123"
  And I press "Submit"
  And I should see "Your new password has been saved"
  And I should see "Institution membership confirmation"
  And I choose "Profile" in "Content" from main menu
  And the "Student ID" field should contain "64000005"
  And I follow "Contact information"
  And the "Town" field should contain "Stewarts River"
  And the "Mobile phone" field should contain "0491 570 110"
  And I follow "General"
  And the "Occupation" field should contain "Hairdresser"
  And I log out
 #login back as admin
  Given I log in as "admin" with password "Kupuhipa1"
  And I choose "User search" in "Users" from administration menu
 # Check that we can delete a user after upload (Bug #1558864)
  And I follow "user0005"
  And I follow "Suspend or delete this user"
  And I scroll to the id "delete"
  And I press and confirm "Delete user"
  And I should see "User deleted successfully"
+0 −54
Original line number Diff line number Diff line
@javascript @core @core_administration
Feature: Switches on general accounts
In order to change settings
As an admin
I need to be able to switch switches back and forth

Scenario: Turning switchboxes on and off in diff areas (Bug 1431569)
 Given I log in as "admin" with password "Kupuhipa1"
 # In the adding users area
 When I choose "Add user" in "Users" from administration menu
 And I press "General account options"
 # Changing the switches to their opposite setting
 And I set the following fields to these values:
 | HTML editor | 0 |
 | Disable email | 1 |
 | Show controls to add and remove columns when editing a page | 1 |
 | Multiple journals | 1 |
 | Dashboard information | 0 |
 And I press "×" in the "div.modal-header" "css_element"
 And I fill in the following:
 | firstname   | white  |
 | lastname    | valiant    |
 | email       | wv@example.org |
 | username    | wval  |
 | password    | mahara1  |
 And I press "Create user"
 # In the Admin block adding users by CSV area
 And I choose "Add users by CSV" in "Users" from administration menu
 And I follow "General account options"
 # Changing the switches to the opposite setting
 And I set the following fields to these values:
 | HTML editor | 0 |
 | Disable email | 1 |
 | Show controls to add and remove columns when editing a page | 1 |
 | Multiple journals | 1 |
 | Dashboard information | 0 |
 And I attach the file "UserCSV.csv" to "CSV file"
 And I disable the switch "Force password change"
 And I disable the switch "Email users about their account"
 And I press "Add users by CSV"
 # Navigating to the account index
 And I log out
 Then I log in as "bob01" with password "Mahara1"
 And I go to "account/index.php"
 And I should not see "Undefined index:"
 # Changing the switches to their opposite setting
 And I set the following fields to these values:
 | HTML editor | 1 |
 | Disable email | 0 |
 | Show controls to add and remove columns when editing a page | 0 |
 | Multiple journals | 0 |
 | Maximum tags in cloud | 15 |
 | Dashboard information | 1 |
 And I press "Save"
+21 −0
Original line number Diff line number Diff line
username,email,firstname,lastname,mobilenumber,town,studentid,occupation
user0001,user1@example.org,User0001,User0001,0491 570 156,Weethalle,64000001,Referee
user0002,user2@example.org,User0002,User0002,0491 570 157,Waratah,64000002,Chemist
user0003,user3@example.org,User0003,User0003,0491 570 158,Morrison,64000003,Paralegal
user0004,user4@example.org,User0004,User0004,0491 570 159,Oakwood,64000004,Insurance Agent
user0005,user5@example.net,User0005,User0005,0491 570 110,Stewarts River,64000005,Hairdresser
user0006,user6@example.org,User0006,User0006,0491 570 156,Benloch,64000006,High School Teacher
user0007,user7@example.org,User0007,User0007,0491 570 157,Jimna,64000007,Radiologic Technologist
user0008,user8@example.org,User0008,User0008,0491 570 158,Elizabeth,64000008,Automotive mechanic
user0009,user9@example.org,User0009,User0009,0491 570 159,Kingsvale,64000009,Urban Planner
user0010,user10@example.org,User0010,User0010,0491 570 110,Upper Tallebudgera,64000010,College Professor
user0011,user11@example.org,User0011,User0011,0491 570 156,Oruanui,64000011,Interpreter & Translator
user0012,user12@example.org,User0012,User0012,0491 570 157,Tokatoka,64000012,Landscape Architect
user0013,user13@example.org,User0013,User0013,0491 570 158,Mangaroa,64000013,Loan Officer
user0014,user14@example.org,User0014,User0014,0491 570 159,Waikakaho,64000014,Construction Manager
user0015,user15@example.org,User0015,User0015,0491 570 110,Foxhill,64000015,Systems Analyst
user0016,user16@example.org,User0016,User0016,0491 570 156,Tiroroa,64000016,Elementary School Teacher
user0017,user17@example.org,User0017,User0017,0491 570 157,Overdale,64000017,Zoologist
user0018,user18@example.org,User0018,User0018,0491 570 158,Ngapuna,64000018,Zoologist
user0019,user19@example.org,User0019,User0019,0491 570 159,Kohekohe,64000019,Radiologic Technologist
user0020,user20@example.org,User0020,User0020,0491 570 110,Rangiuru,64000020,Teacher
Loading