createUser.feature 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. @administration
  2. Feature: Users management as admin
  3. In order to add users
  4. As an administrator
  5. I need to be able to create new users
  6. Scenario: See the users list link on the admin page
  7. Given I am a platform administrator
  8. And I am on "/main/admin/index.php"
  9. Then I should see "Users list"
  10. Scenario: See the user creation link on the admin page
  11. Given I am a platform administrator
  12. And I am on "/main/admin/index.php"
  13. Then I should see "Add a user"
  14. Scenario: Create a user with only basic info
  15. Given I am a platform administrator
  16. And I am on "/main/admin/user_add.php"
  17. And I fill in the following:
  18. | firstname | Sammy |
  19. | lastname | Marshall |
  20. | email | smarshall@example.com |
  21. | username | smarshall |
  22. | password | smarshall |
  23. And I press "submit"
  24. Then I should see "The user has been added"
  25. Scenario: Search and delete a user
  26. Given I am a platform administrator
  27. And Admin top bar is disabled
  28. And I am on "/main/admin/user_list.php"
  29. And I fill in "keyword" with "smarshall"
  30. And I press "submit"
  31. When I follow "Delete"
  32. And I confirm the popup
  33. Then I should see "The user has been deleted"
  34. Scenario: Create a HRM user
  35. Given I am a platform administrator
  36. And I am on "/main/admin/user_add.php"
  37. And I fill in the following:
  38. | firstname | HRM firstname|
  39. | lastname | HRM lastname |
  40. | email | hrm@example.com |
  41. | username | hrm |
  42. | password | hrm |
  43. And I fill in select bootstrap static input "#status_select" select "4"
  44. And I press "submit"
  45. Then I should see "The user has been added"
  46. Scenario: Create a teacher user
  47. Given I am a platform administrator
  48. And I am on "/main/admin/user_add.php"
  49. And I fill in the following:
  50. | firstname | teacher firstname|
  51. | lastname | teacher lastname |
  52. | email | teacher@example.com |
  53. | username | teacher |
  54. | password | teacher |
  55. And I fill in select bootstrap static input "#status_select" select "1"
  56. And I press "submit"
  57. Then I should see "The user has been added"
  58. Scenario: Create a student user
  59. Given I am a platform administrator
  60. And I am on "/main/admin/user_add.php"
  61. And I fill in the following:
  62. | firstname | student firstname|
  63. | lastname | student lastname |
  64. | email | student@example.com |
  65. | username | student |
  66. | password | student |
  67. And I fill in select bootstrap static input "#status_select" select "5"
  68. And I press "submit"
  69. Then I should see "The user has been added"
  70. Scenario: HRM follows teacher
  71. Given I am a platform administrator
  72. And I am on "/main/admin/user_list.php?keyword=hrm&submit=&_qf__search_simple="
  73. And I should see "HRM lastname"
  74. And I should see "Human Resources Manager"
  75. And I follow "Assign users"
  76. And I select "teacher firstname teacher lastname" from "NoAssignedUsersList[]"
  77. And I press "add_user_button"
  78. And I press "assign_user"
  79. Then I should see "The assigned users have been updated"
  80. Scenario: HRM follows student
  81. Given I am a platform administrator
  82. And I am on "/main/admin/user_list.php?keyword=hrm&submit=&_qf__search_simple="
  83. And I should see "HRM lastname"
  84. And I should see "Human Resources Manager"
  85. And I follow "Assign users"
  86. And I select "student firstname student lastname" from "NoAssignedUsersList[]"
  87. And I press "add_user_button"
  88. And I press "assign_user"
  89. Then I should see "The assigned users have been updated"
  90. Scenario: HRM logs as teacher
  91. Given I am logged as "hrm"
  92. And I am on "/main/mySpace/teachers.php"
  93. Then I should see "teacher lastname"
  94. Then I follow "teacher lastname"
  95. And wait for the page to be loaded
  96. And I follow "Login as"
  97. And wait for the page to be loaded
  98. Then I should see "Login successful"
  99. Scenario: HRM logs as student
  100. Given I am logged as "hrm"
  101. And I am on "/main/mySpace/student.php"
  102. Then I should see "student lastname"
  103. Then I follow "student lastname"
  104. And wait for the page to be loaded
  105. And I follow "Login as"
  106. And wait for the page to be loaded
  107. Then I should see "Login successful"