Add HRM follows teacher/student tests

pull/2487/head
jmontoyaa 8 years ago
parent e859abc4ea
commit a3022284dd
  1. 6
      main/admin/dashboard_add_users_to_user.php
  2. 4
      main/mySpace/student.php
  3. 75
      tests/behat/features/createUser.feature

@ -451,19 +451,19 @@ $result = Database::query($sql);
</div>
<?php } else { ?>
<div class="separate-action">
<button class="btn btn-primary" type="button" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))">
<button id="add_user_button" class="btn btn-primary" type="button" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))">
<em class="fa fa-chevron-right"></em>
</button>
</div>
<div class="separate-action">
<button class="btn btn-primary" type="button" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))">
<button id="remove_user_button" class="btn btn-primary" type="button" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))">
<em class="fa fa-chevron-left"></em>
</button>
</div>
<?php } ?>
<div class="separate-action">
<?php
echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
echo '<button id="assign_user" class="btn btn-success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
?>
</div>
</div>

@ -163,10 +163,10 @@ function get_users($from, $limit, $column, $direction)
if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
$detailsLink = '<a href="myStudents.php?student='.$student_id.'&id_coach='.$coach_id.'&id_session='.$sessionId.'">
'.Display::return_icon('2rightarrow.png').'</a>';
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
} else {
$detailsLink = '<a href="myStudents.php?student='.$student_id.'">
'.Display::return_icon('2rightarrow.png').'</a>';
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
}
$lostPasswordLink = '';

@ -35,3 +35,78 @@ Feature: Users management as admin
When I follow "Delete"
And I confirm the popup
Then I should see "The user has been deleted"
Scenario: Create a HRM user
Given I am a platform administrator
And I am on "/main/admin/user_add.php"
And I fill in the following:
| firstname | HRM firstname|
| lastname | HRM lastname |
| email | hrm@example.com |
| username | hrm |
| password | hrm |
And I fill in select bootstrap static input "#status_select" select "4"
And I press "submit"
Then I should see "The user has been added"
Scenario: Create a teacher user
Given I am a platform administrator
And I am on "/main/admin/user_add.php"
And I fill in the following:
| firstname | teacher firstname|
| lastname | teacher lastname |
| email | teacher@example.com |
| username | teacher |
| password | teacher |
And I fill in select bootstrap static input "#status_select" select "1"
And I press "submit"
Then I should see "The user has been added"
Scenario: Create a student user
Given I am a platform administrator
And I am on "/main/admin/user_add.php"
And I fill in the following:
| firstname | student firstname|
| lastname | student lastname |
| email | student@example.com |
| username | student |
| password | student |
And I fill in select bootstrap static input "#status_select" select "5"
And I press "submit"
Then I should see "The user has been added"
Scenario: HRM follows teacher
Given I am a platform administrator
And I am on "/main/admin/user_list.php?keyword=hrm&submit=&_qf__search_simple="
And I should see "HRM lastname"
And I follow "Assign users"
And I select "teacher firstname teacher lastname" from "NoAssignedUsersList[]"
And I press "add_user_button"
And I press "assign_user"
Then I should see "The assigned users have been updated"
Scenario: HRM follows student
Given I am a platform administrator
And I am on "/main/admin/user_list.php?keyword=hrm&submit=&_qf__search_simple="
And I should see "HRM lastname"
And I follow "Assign users"
And I select "student firstname student lastname" from "NoAssignedUsersList[]"
And I press "add_user_button"
And I press "assign_user"
Then I should see "The assigned users have been updated"
Scenario: HRM logs as teacher
Given I am logged as "hrm"
And I am on "/main/mySpace/teachers.php"
And I should see "teacher lastname"
And I follow "Details"
And I follow "Login as"
Then I should see "Login successful"
Scenario: HRM logs as student
Given I am logged as "hrm"
And I am on "/main/mySpace/student.php"
And I should see "student lastname"
And I follow "Details"
And I follow "Login as"
Then I should see "Login successful"

Loading…
Cancel
Save