jmontoyaa vor 7 Jahren
Ursprung
Commit
55184d3150
2 geänderte Dateien mit 102 neuen und 94 gelöschten Zeilen
  1. 8 4
      main/mySpace/teachers.php
  2. 94 90
      tests/behat/features/createUser.feature

+ 8 - 4
main/mySpace/teachers.php

@@ -158,11 +158,15 @@ function get_users($from, $limit, $column, $direction)
         $row[] = $string_date;
 
         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', get_lang('Details')).'</a>';
+            $detailsLink = Display::url(
+                Display::return_icon('2rightarrow.png', get_lang('Details')),
+                "myStudents.php?student=$student_id&id_coach=$coach_id&id_session=$sessionId"
+            );
         } else {
-            $detailsLink = '<a href="myStudents.php?student='.$student_id.'&origin=teacher_details">
-				            '.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>';
+            $detailsLink = Display::url(
+                Display::return_icon('2rightarrow.png', get_lang('Details')),
+                "myStudents.php?student=$student_id&origin=teacher_details"
+            );
         }
         $row[] = $detailsLink;
         $all_datas[] = $row;

+ 94 - 90
tests/behat/features/createUser.feature

@@ -4,103 +4,105 @@ Feature: Users management as admin
   As an administrator
   I need to be able to create new users
 
-  Scenario: See the users list link on the admin page
-    Given I am a platform administrator
-    And I am on "/main/admin/index.php"
-    Then I should see "Users list"
-
-  Scenario: See the user creation link on the admin page
-    Given I am a platform administrator
-    And I am on "/main/admin/index.php"
-    Then I should see "Add a user"
-
-  Scenario: Create a user with only basic info
-    Given I am a platform administrator
-    And I am on "/main/admin/user_add.php"
-    And I fill in the following:
-      | firstname | Sammy                 |
-      | lastname  | Marshall              |
-      | email     | smarshall@example.com |
-      | username  | smarshall             |
-      | password  | smarshall             |
-    And I press "submit"
-    Then I should see "The user has been added"
-
-  Scenario: Search and delete a user
-    Given I am a platform administrator
-    And Admin top bar is disabled
-    And I am on "/main/admin/user_list.php"
-    And I fill in "keyword" with "smarshall"
-    And I press "submit"
-    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: See the users list link on the admin page
+#    Given I am a platform administrator
+#    And I am on "/main/admin/index.php"
+#    Then I should see "Users list"
+#
+#  Scenario: See the user creation link on the admin page
+#    Given I am a platform administrator
+#    And I am on "/main/admin/index.php"
+#    Then I should see "Add a user"
+#
+#  Scenario: Create a user with only basic info
+#    Given I am a platform administrator
+#    And I am on "/main/admin/user_add.php"
+#    And I fill in the following:
+#      | firstname | Sammy                 |
+#      | lastname  | Marshall              |
+#      | email     | smarshall@example.com |
+#      | username  | smarshall             |
+#      | password  | smarshall             |
+#    And I press "submit"
+#    Then I should see "The user has been added"
+#
+#  Scenario: Search and delete a user
+#    Given I am a platform administrator
+#    And Admin top bar is disabled
+#    And I am on "/main/admin/user_list.php"
+#    And I fill in "keyword" with "smarshall"
+#    And I press "submit"
+#    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 wait for the page to be loaded
     And I follow "Login as"
+    And wait for the page to be loaded
     Then I should see "Login successful"
 
   Scenario: HRM logs as student
@@ -108,5 +110,7 @@ Feature: Users management as admin
     And I am on "/main/mySpace/student.php"
     And I should see "student lastname"
     And I follow "Details"
+    And wait for the page to be loaded
     And I follow "Login as"
+    And wait for the page to be loaded
     Then I should see "Login successful"