Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@enrol @enrol_manual
2
Feature: A teacher can manage manually enrolled users in their course
3
  In order to manage manually enrolled students in my course
4
  As a teacher
5
  I can manually add and remove users in my course
6
 
7
  Background:
8
    Given the following "custom profile fields" exist:
9
      | datatype | shortname | name  |
10
      | text     | fruit     | Fruit |
11
    And the following "users" exist:
12
      | username | firstname | middlename | lastname | email               | profile_field_fruit |
13
      | teacher  | Teacher   |            | User     | teacher@example.com |                     |
14
      | user1    | First     | Alice      | User     | first@example.com   | Apple               |
15
      | user2    | Second    | Bob        | User     | second@example.com  | Banana              |
16
    And the following "courses" exist:
17
      | fullname | shortname | category |
18
      | Course 1 | C1        | 0        |
19
    And the following "course enrolments" exist:
20
      | user    | course | role           |
21
      | teacher | C1     | editingteacher |
22
 
23
  @javascript
24
  Scenario Outline: Manually enrolling users should observe alternative fullname format
25
    Given the following config values are set as admin:
26
      | alternativefullnameformat | firstname middlename lastname |
27
    And the following "permission overrides" exist:
28
      | capability                | permission   | role           | contextlevel | reference |
29
      | moodle/site:viewfullnames | <permission> | editingteacher | Course       | C1        |
30
    When I am on the "Course 1" "enrolment methods" page logged in as "teacher"
31
    And I click on "Enrol users" "link" in the "Manual enrolments" "table_row"
32
    And I set the field "addselect_searchtext" to "First"
33
    And I wait "1" seconds
34
    And I set the field "Not enrolled users" to "<expectedfullname> (first@example.com)"
35
    And I press "Add"
36
    Then the "Enrolled users" select box should contain "<expectedfullname> (first@example.com)"
37
    Examples:
38
      | permission | expectedfullname |
39
      | Allow      | First Alice User |
40
      | Prohibit   | First User       |
41
 
42
  @javascript
43
  Scenario Outline: Manually unenrolling users should observe alternative fullname format
44
    Given the following config values are set as admin:
45
      | alternativefullnameformat | firstname middlename lastname |
46
    And the following "permission overrides" exist:
47
      | capability                | permission   | role           | contextlevel | reference |
48
      | moodle/site:viewfullnames | <permission> | editingteacher | Course       | C1        |
49
    And the following "course enrolments" exist:
50
      | user  | course | role    |
51
      | user1 | C1     | student |
52
      | user2 | C1     | student |
53
    When I am on the "Course 1" "enrolment methods" page logged in as "teacher"
54
    And I click on "Enrol users" "link" in the "Manual enrolments" "table_row"
55
    And I set the field "removeselect_searchtext" to "First"
56
    And I wait "1" seconds
57
    And I set the field "Enrolled users" to "<expectedfullname> (first@example.com)"
58
    And I press "Remove"
59
    Then the "Not enrolled users" select box should contain "<expectedfullname> (first@example.com)"
60
    Examples:
61
      | permission | expectedfullname |
62
      | Allow      | First Alice User |
63
      | Prohibit   | First User       |
64
 
65
  @javascript
66
  Scenario: Manually enrol users in course using custom user profile fields
67
    Given the following config values are set as admin:
68
      | showuseridentity | email,profile_field_fruit |
69
    When I am on the "Course 1" "enrolment methods" page logged in as "teacher"
70
    And I click on "Enrol users" "link" in the "Manual enrolments" "table_row"
71
    Then the "Not enrolled users" select box should contain "Second User (second@example.com\, Banana)"
72
    And I set the field "addselect_searchtext" to "Apple"
73
    And I wait "1" seconds
74
    And the "Not enrolled users" select box should not contain "Second User (second@example.com\, Banana)"
75
    And I set the field "Not enrolled users" to "First User (first@example.com\, Apple)"
76
    And I press "Add"
77
    And the "Enrolled users" select box should contain "First User (first@example.com\, Apple)"
78
 
79
  @javascript
80
  Scenario: Manually unenrol users in course using custom user profile fields
81
    Given the following config values are set as admin:
82
      | showuseridentity | email,profile_field_fruit |
83
    And the following "course enrolments" exist:
84
      | user  | course | role    |
85
      | user1 | C1     | student |
86
      | user2 | C1     | student |
87
    When I am on the "Course 1" "enrolment methods" page logged in as "teacher"
88
    And I click on "Enrol users" "link" in the "Manual enrolments" "table_row"
89
    Then the "Enrolled users" select box should contain "Second User (second@example.com\, Banana)"
90
    And I set the field "removeselect_searchtext" to "Apple"
91
    And I wait "1" seconds
92
    And the "Enrolled users" select box should not contain "Second User (second@example.com\, Banana)"
93
    And I set the field "Enrolled users" to "First User (first@example.com\, Apple)"
94
    And I press "Remove"
95
    And the "Not enrolled users" select box should contain "First User (first@example.com\, Apple)"