MDL-59666 mod_assign: Disable remind to grade by field in override tests
[moodle.git] / mod / assign / tests / behat / assign_group_override.feature
CommitLineData
d685b959
IT
1@mod @mod_assign
2Feature: Assign group override
3 In order to grant a group special access to an assignment
4 As a teacher
5 I need to create an override for that group.
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher1 | Tina | Teacher1 | teacher1@example.com |
11 | student1 | Sam1 | Student1 | student1@example.com |
12 | student2 | Sam2 | Student2 | student2@example.com |
13 | student3 | Sam3 | Student3 | student3@example.com |
14 And the following "courses" exist:
15 | fullname | shortname | category |
16 | Course 1 | C1 | 0 |
17 And the following "course enrolments" exist:
18 | user | course | role |
19 | teacher1 | C1 | editingteacher |
20 | student1 | C1 | student |
21 | student2 | C1 | student |
22 | student3 | C1 | student |
23 And the following "groups" exist:
24 | name | course | idnumber |
25 | Group 1 | C1 | G1 |
26 | Group 2 | C1 | G2 |
27 Given the following "group members" exist:
28 | user | group |
29 | student1 | G1 |
30 | student2 | G2 |
31 | student3 | G1 |
32 And I log in as "teacher1"
fdeeaff9 33 And I am on "Course 1" course homepage with editing mode on
d685b959
IT
34 And I add a "Assignment" to section "1" and I fill the form with:
35 | Assignment name | Test assignment name |
36 | Description | Submit your online text |
37 | assignsubmission_onlinetext_enabled | 1 |
38 | assignsubmission_onlinetext_wordlimit_enabled | 1 |
39 | assignsubmission_onlinetext_wordlimit | 10 |
40 | assignsubmission_file_enabled | 0 |
10994cbc 41 | gradingduedate[enabled] | 0 |
d685b959
IT
42
43 Scenario: Add, modify then delete a group override
44 When I follow "Test assignment name"
e5287f9b 45 And I navigate to "Group overrides" in current page administration
d685b959
IT
46 And I press "Add group override"
47 And I set the following fields to these values:
48 | Override group | Group 1 |
49 | id_duedate_enabled | 1 |
50 | duedate[day] | 1 |
51 | duedate[month] | January |
52 | duedate[year] | 2020 |
53 | duedate[hour] | 08 |
54 | duedate[minute] | 00 |
55 And I press "Save"
56 And I should see "Wednesday, 1 January 2020, 8:00"
325ac748 57 Then I click on "Edit" "link" in the "Group 1" "table_row"
d685b959
IT
58 And I set the following fields to these values:
59 | duedate[year] | 2030 |
60 And I press "Save"
61 And I should see "Tuesday, 1 January 2030, 8:00"
62 And I click on "Delete" "link"
63 And I press "Continue"
64 And I should not see "Group 1"
65
66 Scenario: Duplicate a user override
67 When I follow "Test assignment name"
e5287f9b 68 And I navigate to "Group overrides" in current page administration
d685b959
IT
69 And I press "Add group override"
70 And I set the following fields to these values:
71 | Override group | Group 1 |
72 | id_duedate_enabled | 1 |
73 | duedate[day] | 1 |
74 | duedate[month] | January |
75 | duedate[year] | 2020 |
76 | duedate[hour] | 08 |
77 | duedate[minute] | 00 |
78 And I press "Save"
79 And I should see "Wednesday, 1 January 2020, 8:00"
80 Then I click on "copy" "link"
81 And I set the following fields to these values:
82 | Override group | Group 2 |
83 | duedate[year] | 2030 |
84 And I press "Save"
85 And I should see "Tuesday, 1 January 2030, 8:00"
86 And I should see "Group 2"
87
88 Scenario: Allow a group to have a different due date
89 When I follow "Test assignment name"
e5287f9b 90 And I navigate to "Edit settings" in current page administration
d685b959
IT
91 And I set the following fields to these values:
92 | id_duedate_enabled | 1 |
93 | id_allowsubmissionsfromdate_enabled | 0 |
94 | id_cutoffdate_enabled | 0 |
95 | duedate[day] | 1 |
96 | duedate[month] | January |
97 | duedate[year] | 2000 |
98 | duedate[hour] | 08 |
99 | duedate[minute] | 00 |
100 And I press "Save and display"
e5287f9b 101 And I navigate to "Group overrides" in current page administration
d685b959
IT
102 And I press "Add group override"
103 And I set the following fields to these values:
104 | Override group | Group 1 |
105 | id_duedate_enabled | 1 |
106 | duedate[day] | 1 |
107 | duedate[month] | January |
108 | duedate[year] | 2020 |
109 | duedate[hour] | 08 |
110 | duedate[minute] | 00 |
111 And I press "Save"
112 And I should see "Wednesday, 1 January 2020, 8:00"
113 And I log out
114 And I log in as "student2"
fdeeaff9 115 And I am on "Course 1" course homepage
d685b959
IT
116 And I follow "Test assignment name"
117 Then I should see "Saturday, 1 January 2000, 8:00"
118 And I log out
119 And I log in as "student1"
fdeeaff9 120 And I am on "Course 1" course homepage
d685b959
IT
121 And I follow "Test assignment name"
122 And I should see "Wednesday, 1 January 2020, 8:00"
123
124 Scenario: Allow a group to have a different cut off date
125 When I follow "Test assignment name"
e5287f9b 126 And I navigate to "Edit settings" in current page administration
d685b959
IT
127 And I set the following fields to these values:
128 | id_duedate_enabled | 0 |
129 | id_allowsubmissionsfromdate_enabled | 0 |
130 | id_cutoffdate_enabled | 1 |
131 | cutoffdate[day] | 1 |
132 | cutoffdate[month] | January |
133 | cutoffdate[year] | 2000 |
134 | cutoffdate[hour] | 08 |
135 | cutoffdate[minute] | 00 |
136 And I press "Save and display"
e5287f9b 137 And I navigate to "Group overrides" in current page administration
d685b959
IT
138 And I press "Add group override"
139 And I set the following fields to these values:
140 | Override group | Group 1 |
141 | id_cutoffdate_enabled | 1 |
142 | cutoffdate[day] | 1 |
143 | cutoffdate[month] | January |
144 | cutoffdate[year] | 2020 |
145 | cutoffdate[hour] | 08 |
146 | cutoffdate[minute] | 00 |
147 And I press "Save"
148 And I should see "Wednesday, 1 January 2020, 8:00"
149 And I log out
150 And I log in as "student2"
fdeeaff9 151 And I am on "Course 1" course homepage
d685b959
IT
152 And I follow "Test assignment name"
153 Then I should not see "Make changes to your submission"
154 And I log out
155 And I log in as "student1"
fdeeaff9 156 And I am on "Course 1" course homepage
d685b959
IT
157 And I follow "Test assignment name"
158 And I should see "Make changes to your submission"
159
160 Scenario: Allow a group to have a different start date
161 When I follow "Test assignment name"
e5287f9b 162 And I navigate to "Edit settings" in current page administration
d685b959
IT
163 And I set the following fields to these values:
164 | id_duedate_enabled | 0 |
165 | id_allowsubmissionsfromdate_enabled | 1 |
166 | id_cutoffdate_enabled | 0 |
167 | allowsubmissionsfromdate[day] | 1 |
168 | allowsubmissionsfromdate[month] | January |
169 | allowsubmissionsfromdate[year] | 2020 |
170 | allowsubmissionsfromdate[hour] | 08 |
171 | allowsubmissionsfromdate[minute] | 00 |
172 And I press "Save and display"
e5287f9b 173 And I navigate to "Group overrides" in current page administration
d685b959
IT
174 And I press "Add group override"
175 And I set the following fields to these values:
176 | Override group | Group 1 |
177 | id_allowsubmissionsfromdate_enabled | 1 |
178 | allowsubmissionsfromdate[day] | 1 |
179 | allowsubmissionsfromdate[month] | January |
180 | allowsubmissionsfromdate[year] | 2015 |
181 | allowsubmissionsfromdate[hour] | 08 |
182 | allowsubmissionsfromdate[minute] | 00 |
183 And I press "Save"
184 And I should see "Thursday, 1 January 2015, 8:00"
185 And I log out
186 And I log in as "student2"
fdeeaff9 187 And I am on "Course 1" course homepage
d685b959
IT
188 And I follow "Test assignment name"
189 Then I should see "This assignment will accept submissions from Wednesday, 1 January 2020, 8:00"
190 And I should not see "Add submission"
191 And I log out
192 And I log in as "student1"
fdeeaff9 193 And I am on "Course 1" course homepage
d685b959
IT
194 And I follow "Test assignment name"
195 And I should not see "This assignment will accept submissions from Wednesday, 1 January 2020, 8:00"
196
eaefd5bc 197 @javascript
d685b959
IT
198 Scenario: Add both a user and group override and verify that both are applied correctly
199 When I follow "Test assignment name"
e5287f9b 200 And I navigate to "Edit settings" in current page administration
d685b959
IT
201 And I set the following fields to these values:
202 | id_duedate_enabled | 0 |
203 | id_allowsubmissionsfromdate_enabled | 1 |
204 | id_cutoffdate_enabled | 0 |
205 | allowsubmissionsfromdate[day] | 1 |
206 | allowsubmissionsfromdate[month] | January |
207 | allowsubmissionsfromdate[year] | 2030 |
208 | allowsubmissionsfromdate[hour] | 08 |
209 | allowsubmissionsfromdate[minute] | 00 |
210 And I press "Save and display"
e5287f9b 211 And I navigate to "Group overrides" in current page administration
d685b959
IT
212 And I press "Add group override"
213 And I set the following fields to these values:
214 | Override group | Group 1 |
215 | id_allowsubmissionsfromdate_enabled | 1 |
216 | allowsubmissionsfromdate[day] | 1 |
217 | allowsubmissionsfromdate[month] | January |
218 | allowsubmissionsfromdate[year] | 2020 |
219 | allowsubmissionsfromdate[hour] | 08 |
220 | allowsubmissionsfromdate[minute] | 00 |
221 And I press "Save"
222 And I should see "Wednesday, 1 January 2020, 8:00"
e5287f9b
MG
223 And I follow "Test assignment name"
224 And I navigate to "User overrides" in current page administration
d685b959
IT
225 And I press "Add user override"
226 And I set the following fields to these values:
227 | Override user | Student1 |
228 | id_allowsubmissionsfromdate_enabled | 1 |
229 | allowsubmissionsfromdate[day] | 1 |
230 | allowsubmissionsfromdate[month] | January |
231 | allowsubmissionsfromdate[year] | 2021 |
232 | allowsubmissionsfromdate[hour] | 08 |
233 | allowsubmissionsfromdate[minute] | 00 |
234 And I press "Save"
235 And I should see "Friday, 1 January 2021, 8:00"
236 And I log out
237 Then I log in as "student1"
fdeeaff9 238 And I am on "Course 1" course homepage
d685b959
IT
239 And I follow "Test assignment name"
240 And I should see "This assignment will accept submissions from Friday, 1 January 2021, 8:00"
241 And I log out
242 And I log in as "student2"
fdeeaff9 243 And I am on "Course 1" course homepage
d685b959
IT
244 And I follow "Test assignment name"
245 And I should see "This assignment will accept submissions from Tuesday, 1 January 2030, 8:00"
246 And I log out
247 And I log in as "student3"
fdeeaff9 248 And I am on "Course 1" course homepage
d685b959
IT
249 And I follow "Test assignment name"
250 And I should see "This assignment will accept submissions from Wednesday, 1 January 2020, 8:00"