MDL-63293 enrol_manual: observe user paging config in enrol dialog.
[moodle.git] / enrol / manual / tests / behat / quickenrolment.feature
CommitLineData
3dbda9f8
DM
1@enrol @enrol_manual
2Feature: Teacher can search and enrol users one by one into the course
3 In order to quickly enrol particular students into my course
4 As a teacher
5 I can search for the students and enrol them into the course
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher001 | Teacher | 001 | teacher001@example.com |
11 | student001 | Student | 001 | student001@example.com |
12 | student002 | Student | 002 | student002@example.com |
13 | student003 | Student | 003 | student003@example.com |
14 | student004 | Student | 004 | student004@example.com |
15 | student005 | Student | 005 | student005@example.com |
16 | student006 | Student | 006 | student006@example.com |
17 | student007 | Student | 007 | student007@example.com |
18 | student008 | Student | 008 | student008@example.com |
19 | student009 | Student | 009 | student009@example.com |
20 | student010 | Student | 010 | student010@example.com |
21 | student011 | Student | 011 | student011@example.com |
22 | student012 | Student | 012 | student012@example.com |
23 | student013 | Student | 013 | student013@example.com |
24 | student014 | Student | 014 | student014@example.com |
25 | student015 | Student | 015 | student015@example.com |
26 | student016 | Student | 016 | student016@example.com |
27 | student017 | Student | 017 | student017@example.com |
28 | student018 | Student | 018 | student018@example.com |
29 | student019 | Student | 019 | student019@example.com |
30 | student020 | Student | 020 | student020@example.com |
31 | student021 | Student | 021 | student021@example.com |
32 | student022 | Student | 022 | student022@example.com |
33 | student023 | Student | 023 | student023@example.com |
34 | student024 | Student | 024 | student024@example.com |
35 | student025 | Student | 025 | student025@example.com |
36 | student026 | Student | 026 | student026@example.com |
37 | student027 | Student | 027 | student027@example.com |
38 | student028 | Student | 028 | student028@example.com |
39 | student029 | Student | 029 | student029@example.com |
40 | student030 | Student | 030 | student030@example.com |
41 | student031 | Student | 031 | student031@example.com |
42 | student032 | Student | 032 | student032@example.com |
43 | student033 | Student | 033 | student033@example.com |
44 | student034 | Student | 034 | student034@example.com |
45 | student035 | Student | 035 | student035@example.com |
46 | student036 | Student | 036 | student036@example.com |
47 | student037 | Student | 037 | student037@example.com |
48 | student038 | Student | 038 | student038@example.com |
49 | student039 | Student | 039 | student039@example.com |
50 | student040 | Student | 040 | student040@example.com |
51 | student041 | Student | 041 | student041@example.com |
52 | student042 | Student | 042 | student042@example.com |
53 | student043 | Student | 043 | student043@example.com |
54 | student044 | Student | 044 | student044@example.com |
55 | student045 | Student | 045 | student045@example.com |
56 | student046 | Student | 046 | student046@example.com |
57 | student047 | Student | 047 | student047@example.com |
58 | student048 | Student | 048 | student048@example.com |
59 | student049 | Student | 049 | student049@example.com |
60 | student050 | Student | 050 | student050@example.com |
61 | student051 | Student | 051 | student051@example.com |
62 | student052 | Student | 052 | student052@example.com |
63 | student053 | Student | 053 | student053@example.com |
64 | student054 | Student | 054 | student054@example.com |
65 | student055 | Student | 055 | student055@example.com |
66 | student056 | Student | 056 | student056@example.com |
67 | student057 | Student | 057 | student057@example.com |
68 | student058 | Student | 058 | student058@example.com |
69 | student059 | Student | 059 | student059@example.com |
70 | student060 | Student | 060 | student060@example.com |
71 | student061 | Student | 061 | student061@example.com |
72 | student062 | Student | 062 | student062@example.com |
73 | student063 | Student | 063 | student063@example.com |
74 | student064 | Student | 064 | student064@example.com |
75 | student065 | Student | 065 | student065@example.com |
76 | student066 | Student | 066 | student066@example.com |
77 | student067 | Student | 067 | student067@example.com |
78 | student068 | Student | 068 | student068@example.com |
79 | student069 | Student | 069 | student069@example.com |
80 | student070 | Student | 070 | student070@example.com |
81 | student071 | Student | 071 | student071@example.com |
82 | student072 | Student | 072 | student072@example.com |
83 | student073 | Student | 073 | student073@example.com |
84 | student074 | Student | 074 | student074@example.com |
85 | student075 | Student | 075 | student075@example.com |
86 | student076 | Student | 076 | student076@example.com |
87 | student077 | Student | 077 | student077@example.com |
88 | student078 | Student | 078 | student078@example.com |
89 | student079 | Student | 079 | student079@example.com |
90 | student080 | Student | 080 | student080@example.com |
91 | student081 | Student | 081 | student081@example.com |
92 | student082 | Student | 082 | student082@example.com |
93 | student083 | Student | 083 | student083@example.com |
94 | student084 | Student | 084 | student084@example.com |
95 | student085 | Student | 085 | student085@example.com |
96 | student086 | Student | 086 | student086@example.com |
97 | student087 | Student | 087 | student087@example.com |
98 | student088 | Student | 088 | student088@example.com |
99 | student089 | Student | 089 | student089@example.com |
100 | student090 | Student | 090 | student090@example.com |
101 | student091 | Student | 091 | student091@example.com |
102 | student092 | Student | 092 | student092@example.com |
103 | student093 | Student | 093 | student093@example.com |
104 | student094 | Student | 094 | student094@example.com |
105 | student095 | Student | 095 | student095@example.com |
106 | student096 | Student | 096 | student096@example.com |
107 | student097 | Student | 097 | student097@example.com |
108 | student098 | Student | 098 | student098@example.com |
109 | student099 | Student | 099 | student099@example.com |
110 And the following "courses" exist:
0fc30827
HN
111 | fullname | shortname | format | startdate |
112 | Course 001 | C001 | weeks | ##1 month ago## |
3dbda9f8 113 And the following "course enrolments" exist:
0fc30827
HN
114 | user | course | role | timestart |
115 | teacher001 | C001 | editingteacher | ##1 month ago## |
3dbda9f8
DM
116 And I log in as "teacher001"
117 And I am on "Course 001" course homepage
118
119 @javascript
120 Scenario: Teacher can search and enrol one particular student
121 Given I navigate to course participants
122 And I press "Enrol users"
123 When I set the field "Select users" to "student001"
124 And I should see "Student 001"
125 And I click on "Enrol users" "button" in the "Enrol users" "dialogue"
126 Then I should see "Active" in the "Student 001" "table_row"
127
128 @javascript
129 Scenario: Searching for a non-existing user
130 Given I navigate to course participants
131 And I press "Enrol users"
132 And I set the field "Select users" to "qwertyuiop"
133 And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
134 Then I should see "No suggestions"
135
136 @javascript
137 Scenario: If there are less than 100 matching users, all are displayed for selection
138 Given I navigate to course participants
139 And I press "Enrol users"
140 When I set the field "Select users" to "example.com"
141 And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
142 And I click on "Student 099" item in the autocomplete list
143 Then I should see "Student 099"
144
145 @javascript
146 Scenario: If there are more than 100 matching users, inform there are too many.
147 Given the following "users" exist:
148 | username | firstname | lastname | email |
149 | student100 | Student | 100 | student100@example.com |
150 | student101 | Student | 101 | student101@example.com |
151 And I navigate to course participants
152 And I press "Enrol users"
153 When I set the field "Select users" to "example.com"
154 And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
155 Then I should see "Too many users (>100) to show"
26208463 156
b15bb419
PH
157 @javascript
158 Scenario: Changing the Maximum users per page setting affects the enrolment pop-up.
159 Given the following config values are set as admin:
160 | maxusersperpage | 5 |
161 And I navigate to course participants
162 And I press "Enrol users"
163 When I set the field "Select users" to "student00"
164 And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
165 Then I should see "Too many users (>5) to show"
166
26208463
V
167 @javascript
168 Scenario: Change the Show user identity setting affects the enrolment pop-up.
169 Given I log out
170 When I log in as "admin"
171 Then the following "users" exist:
172 | username | firstname | lastname | email | phone1 | phone2 | department | institution | city | country |
173 | student100 | Student | 100 | student100@example.com | 1234567892 | 1234567893 | ABC1 | ABC2 | CITY1 | UK |
174 And the following config values are set as admin:
175 | showuseridentity | idnumber,email,city,country,phone1,phone2,department,institution |
176 When I am on "Course 001" course homepage
177 Then I navigate to course participants
178 And I press "Enrol users"
179 When I set the field "Select users" to "student100@example.com"
180 And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
181 Then I should see "student100@example.com, CITY1, UK, 1234567892, 1234567893, ABC1, ABC2"
182 # Remove identity field in setting User policies
183 And the following config values are set as admin:
184 | showuseridentity | idnumber,email,phone1,phone2,department,institution |
185 When I am on "Course 001" course homepage
186 And I navigate to course participants
187 And I press "Enrol users"
188 When I set the field "Select users" to "student100@example.com"
189 And I click on ".form-autocomplete-downarrow" "css_element" in the "Select users" "form_row"
190 Then I should see "student100@example.com, 1234567892, 1234567893, ABC1, ABC2"
0fc30827 191
b6a226f9
AN
192# The following tests are commented out as a result of MDL-66339.
193# @javascript
194# Scenario: Enrol user from participants page
195# Given I navigate to course participants
196# # Enrol user to course
197# And I press "Enrol users"
198# And I set the field "Select users" to "example.com"
199# And I expand the "Select users" autocomplete
200# When I click on "Student 099" item in the autocomplete list
201# Then I should see "Student 099" in the list of options for the "Select users" autocomplete
202# And I click on "Show more" "button"
203# # Fill data to input duration
204# And "input[name='timeend[enabled]'][checked=checked]" "css_element" should not exist
205# And the "Enrolment duration" "select" should be enabled
206# And I set the field "duration" to "2"
207# # Fill data to input end time
208# And I set the field "Starting from" to "2"
209# And I set the field "timeend[enabled]" to "1"
210# And I set the field "timeend[day]" to "10"
211# And the "Enrolment duration" "select" should be disabled
212# And I click on "Enrol users" "button" in the "Enrol users" "dialogue"
213# And I am on "Course 001" course homepage
214# And I navigate to course participants
215# And I should see "Student 099" in the "participants" "table"
216# And I click on "Edit enrolment" "icon" in the "Student 099" "table_row"
217# And the field "timeend[day]" matches value "10"
218#
219# @javascript
220# Scenario: Update Enrol user
221# Given I am on "Course 001" course homepage
222# And I navigate to course participants
223# When I click on "Edit enrolment" "icon" in the "Teacher 001" "table_row"
224# Then the "Enrolment duration" "select" should be enabled
225# # Fill duration
226# And "input[name='timeend[enabled]'][checked=checked]" "css_element" should not exist
227# And the "Enrolment duration" "select" should be enabled
228# And I set the field "duration" to "2"
229# # Fill end time
230# And I set the field "timeend[enabled]" to "1"
231# And I set the field "timeend[day]" to "28"
232# And the "Enrolment duration" "select" should be disabled
233# And I press "Save changes"
234# And I click on "Edit enrolment" "icon" in the "Teacher 001" "table_row"
235# And the field "timeend[day]" matches value "28"