Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@enrol @enrol_self
2
Feature: Users can auto-enrol themself in courses where self enrolment is allowed
3
  In order to participate in courses
4
  As a user
5
  I need to auto enrol me in courses
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher1 | Teacher | 1 | teacher1@example.com |
11
      | student1 | Student | 1 | student1@example.com |
1441 ariadna 12
      | student2 | Student | 2 | student2@example.com |
1 efrain 13
    And the following "courses" exist:
14
      | fullname | shortname | format |
15
      | Course 1 | C1 | topics |
16
    And the following "course enrolments" exist:
17
      | user | course | role |
18
      | teacher1 | C1 | editingteacher |
19
 
20
  # Note: Please keep the javascript tag on this Scenario to ensure that we
21
  # test use of the singleselect functionality.
22
  @javascript
23
  Scenario: Self-enrolment enabled as guest
24
    Given I log in as "teacher1"
25
    And I add "Self enrolment" enrolment method in "Course 1" with:
26
      | Custom instance name | Test student enrolment |
27
    And I log out
28
    When I am on "Course 1" course homepage
29
    And I press "Access as a guest"
30
    Then I should see "Guests cannot access this course. Please log in."
31
    And I press "Continue"
32
    And I should see "Log in"
33
 
34
  Scenario: Self-enrolment enabled
35
    Given I log in as "teacher1"
36
    When I add "Self enrolment" enrolment method in "Course 1" with:
37
      | Custom instance name | Test student enrolment |
38
    And I log out
39
    And I log in as "student1"
40
    And I am on "Course 1" course homepage
41
    And I press "Enrol me"
42
    Then I should see "New section"
43
    And I should not see "Enrolment options"
44
 
1441 ariadna 45
  @javascript
1 efrain 46
  Scenario: Self-enrolment enabled requiring an enrolment key
47
    Given I log in as "teacher1"
48
    When I add "Self enrolment" enrolment method in "Course 1" with:
49
      | Custom instance name | Test student enrolment |
50
      | Enrolment key | moodle_rules |
51
    And I log out
52
    And I log in as "student1"
53
    And I am on "Course 1" course homepage
1441 ariadna 54
    And I should see "An enrolment key will be required."
55
    And I press "Enrol me"
1 efrain 56
    And I set the following fields to these values:
57
      | Enrolment key | moodle_rules |
1441 ariadna 58
    And I click on "Enrol me" "button" in the "Test student enrolment" "dialogue"
1 efrain 59
    Then I should see "New section"
60
    And I should not see "Enrolment options"
61
    And I should not see "Enrol me in this course"
62
 
63
  Scenario: Self-enrolment disabled
64
    Given I log in as "student1"
65
    When I am on "Course 1" course homepage
66
    Then I should see "You cannot enrol yourself in this course"
67
 
1441 ariadna 68
  @javascript
1 efrain 69
  Scenario: Self-enrolment enabled requiring a group enrolment key
70
    Given I log in as "teacher1"
71
    When I add "Self enrolment" enrolment method in "Course 1" with:
1441 ariadna 72
      | Custom instance name     | Test student enrolment |
73
      | Enrolment key            | moodle_rules           |
74
      | Use group enrolment keys | Yes                    |
1 efrain 75
    And I am on the "Course 1" "groups" page
76
    And I press "Create group"
77
    And I set the following fields to these values:
1441 ariadna 78
      | Group name    | Group 1             |
1 efrain 79
      | Enrolment key | Test-groupenrolkey1 |
80
    And I press "Save changes"
81
    And I log out
82
    And I log in as "student1"
83
    And I am on "Course 1" course homepage
1441 ariadna 84
    And I press "Enrol me"
1 efrain 85
    And I set the following fields to these values:
86
      | Enrolment key | Test-groupenrolkey1 |
1441 ariadna 87
    And I click on "Enrol me" "button" in the "Test student enrolment" "dialogue"
1 efrain 88
    Then I should see "New section"
89
    And I should not see "Enrolment options"
90
    And I should not see "Enrol me in this course"
1441 ariadna 91
    And I am on the "Course 1" course page logged in as student2
92
    And I press "Enrol me"
93
    And I set the following fields to these values:
94
      | Enrolment key | moodle_rules |
95
    And I click on "Enrol me" "button" in the "Test student enrolment" "dialogue"
96
    And I am on the "Course 1" course page logged in as teacher1
97
    And I navigate to course participants
98
    And the following should exist in the "participants" table:
99
      | First name | Email address        | Roles   | Groups    |
100
      | Student 1  | student1@example.com | Student | Group 1   |
101
      | Student 2  | student2@example.com | Student | No groups |
1 efrain 102
 
103
  @javascript
104
  Scenario: Edit a self-enrolled user's enrolment from the course participants page
105
    Given I log in as "teacher1"
106
    When I add "Self enrolment" enrolment method in "Course 1" with:
107
      | Custom instance name | Test student enrolment |
108
    And I log out
109
    And I log in as "student1"
110
    And I am on "Course 1" course homepage
111
    And I press "Enrol me"
112
    And I should see "You are enrolled in the course"
113
    And I log out
114
    And I log in as "teacher1"
115
    And I am on "Course 1" course homepage
116
    And I navigate to course participants
117
    When I click on "//a[@data-action='editenrolment']" "xpath_element" in the "student1" "table_row"
118
    And I should see "Edit Student 1's enrolment"
119
    And I set the field "Status" to "Suspended"
120
    And I click on "Save changes" "button"
121
    Then I should see "Suspended" in the "student1" "table_row"
122
 
123
  @javascript
124
  Scenario: Unenrol a self-enrolled student from the course participants page
125
    Given I log in as "teacher1"
126
    When I add "Self enrolment" enrolment method in "Course 1" with:
127
      | Custom instance name | Test student enrolment |
128
    And I log out
129
    And I log in as "student1"
130
    And I am on "Course 1" course homepage
131
    And I press "Enrol me"
132
    And I should see "You are enrolled in the course"
133
    And I log out
134
    And I log in as "teacher1"
135
    And I am on "Course 1" course homepage
136
    And I navigate to course participants
137
    When I click on "//a[@data-action='unenrol']" "xpath_element" in the "student1" "table_row"
138
    And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
139
    Then I should not see "Student 1" in the "participants" "table"
140
 
141
  @javascript
142
  Scenario: Self unenrol as a self-enrolled student from the course
143
    Given the "multilang" filter is "on"
144
    And the "multilang" filter applies to "content and headings"
145
    And I am on the "C1" "Course" page logged in as "teacher1"
146
    When I add "Self enrolment" enrolment method in "Course 1" with:
147
      | Custom instance name | Test student enrolment |
148
    And I am on "Course 1" course homepage
149
    And I navigate to "Settings" in current page administration
150
    And I set the field "Course full name" in the "General" "fieldset" to "<span lang=\"en\" class=\"multilang\">Course</span><span lang=\"it\" class=\"multilang\">Corso</span> 1"
151
    And I press "Save and display"
152
    And I log out
153
    And I am on the "C1" "Course" page logged in as "student1"
154
    And I press "Enrol me"
155
    And I should see "You are enrolled in the course"
156
    And I am on the "C1" "course" page
157
    And I navigate to "Unenrol me from this course" in current page administration
158
    And I click on "Continue" "button" in the "Confirm" "dialogue"
159
    Then I should see "You are unenrolled from the course \"Course 1\""
160
 
161
  @javascript
162
  Scenario: Self-enrolment enabled with simultaneous guest access
163
    Given I log in as "teacher1"
164
    And I am on the "Course 1" "enrolment methods" page
165
    And I click on "Enable" "link" in the "Self enrolment (Student)" "table_row"
166
    And I click on "Edit" "link" in the "Guest access" "table_row"
167
    And I set the following fields to these values:
168
      | Allow guest access | Yes |
169
    And I press "Save changes"
170
    And I log out
171
    And I log in as "student1"
172
    And I am on "Course 1" course homepage
173
    And I navigate to "Enrol me in this course" in current page administration
174
    And I click on "Enrol me" "button"
175
    Then I should see "New section"