1 |
efrain |
1 |
@tool @tool_policy
|
|
|
2 |
Feature: Viewing acceptances reports and accepting on behalf of other users
|
|
|
3 |
In order to manage user acceptances
|
|
|
4 |
As a manager
|
|
|
5 |
I need to be able to view acceptances and accept on behalf of other users
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following config values are set as admin:
|
|
|
9 |
| sitepolicyhandler | tool_policy |
|
|
|
10 |
# This is required for now to prevent the overflow region affecting the action menus.
|
|
|
11 |
And I change window size to "large"
|
|
|
12 |
And the following policies exist:
|
|
|
13 |
| Name | Revision | Content | Summary | Status |
|
|
|
14 |
| This site policy | | full text2 | short text2 | active |
|
|
|
15 |
| This privacy policy | | full text3 | short text3 | draft |
|
|
|
16 |
And the following "users" exist:
|
|
|
17 |
| username | firstname | lastname | email |
|
|
|
18 |
| user1 | User | One | one@example.com |
|
|
|
19 |
| user2 | User | Two | two@example.com |
|
|
|
20 |
| manager | Max | Manager | man@example.com |
|
|
|
21 |
And the following "role assigns" exist:
|
|
|
22 |
| user | role | contextlevel | reference |
|
|
|
23 |
| manager | manager | System | |
|
|
|
24 |
And the following "courses" exist:
|
|
|
25 |
| fullname | shortname |
|
|
|
26 |
| Course1 | C1 |
|
|
|
27 |
And the following "course enrolments" exist:
|
|
|
28 |
| user | course | role |
|
|
|
29 |
| user1 | C1 | student |
|
|
|
30 |
| user2 | C1 | student |
|
|
|
31 |
|
|
|
32 |
Scenario: View acceptances made by users on their own, single policy
|
|
|
33 |
When I log in as "user1"
|
|
|
34 |
Then I should see "This site policy"
|
|
|
35 |
And I should not see "Course overview"
|
|
|
36 |
And I press "Next"
|
|
|
37 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
38 |
And I press "Next"
|
|
|
39 |
And I should see "Calendar"
|
|
|
40 |
And I log out
|
|
|
41 |
And I log in as "manager"
|
|
|
42 |
And I press "Next"
|
|
|
43 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
44 |
And I press "Next"
|
|
|
45 |
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
|
|
46 |
And "Accepted" "text" should exist in the "User One" "table_row"
|
|
|
47 |
And "Accepted" "text" should exist in the "Max Manager" "table_row"
|
|
|
48 |
And "Pending" "text" should exist in the "User Two" "table_row"
|
|
|
49 |
|
|
|
50 |
Scenario: Agree on behalf of another user as a manager, single policy, javascript off
|
|
|
51 |
Given the following "role capability" exists:
|
|
|
52 |
| role | manager |
|
|
|
53 |
| tool/policy:acceptbehalf | allow |
|
|
|
54 |
When I log in as "manager"
|
|
|
55 |
And I press "Next"
|
|
|
56 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
57 |
And I press "Next"
|
|
|
58 |
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
|
|
59 |
And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"
|
|
|
60 |
And I click on "Accept This site policy" "link" in the "User One" "table_row"
|
|
|
61 |
Then I should see "Accepting policy"
|
|
|
62 |
And I should see "User One"
|
|
|
63 |
And I should see "This site policy"
|
|
|
64 |
And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."
|
|
|
65 |
And I set the field "Remarks" to "Consent received from a parent"
|
|
|
66 |
And I press "Give consent"
|
|
|
67 |
And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"
|
|
|
68 |
And "Max Manager" "link" should exist in the "User One" "table_row"
|
|
|
69 |
And "Consent received from a parent" "text" should exist in the "User One" "table_row"
|
|
|
70 |
And "Pending" "text" should exist in the "User Two" "table_row"
|
|
|
71 |
|
|
|
72 |
@javascript
|
|
|
73 |
Scenario: Agree on behalf of another user as a manager, single policy, javascript on
|
|
|
74 |
Given the following "role capability" exists:
|
|
|
75 |
| role | manager |
|
|
|
76 |
| tool/policy:acceptbehalf | allow |
|
|
|
77 |
When I log in as "manager"
|
|
|
78 |
And I press "Next"
|
|
|
79 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
80 |
And I press "Next"
|
|
|
81 |
And I should see "Calendar"
|
|
|
82 |
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
|
|
83 |
And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"
|
|
|
84 |
And I click on "Accept This site policy" "link" in the "User One" "table_row"
|
|
|
85 |
Then I should see "Give consent"
|
|
|
86 |
And I should see "User One"
|
|
|
87 |
And I should see "This site policy"
|
|
|
88 |
And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."
|
|
|
89 |
And I set the field "Remarks" to "Consent received from a parent"
|
|
|
90 |
And I press "Give consent"
|
|
|
91 |
And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"
|
|
|
92 |
And "Max Manager" "link" should exist in the "User One" "table_row"
|
|
|
93 |
And "Consent received from a parent" "text" should exist in the "User One" "table_row"
|
|
|
94 |
And "Pending" "text" should exist in the "User Two" "table_row"
|
|
|
95 |
|
|
|
96 |
Scenario: View acceptances made by users on their own, multiple policies
|
|
|
97 |
Given I log in as "admin"
|
|
|
98 |
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
|
|
99 |
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
|
|
|
100 |
And I press "Continue"
|
|
|
101 |
And I log out
|
|
|
102 |
When I log in as "user1"
|
|
|
103 |
Then I should see "This site policy"
|
|
|
104 |
And I press "Next"
|
|
|
105 |
And I should see "This privacy policy"
|
|
|
106 |
And I press "Next"
|
|
|
107 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
108 |
And I set the field "I agree to the This privacy policy" to "1"
|
|
|
109 |
And I press "Next"
|
|
|
110 |
And I should see "Calendar"
|
|
|
111 |
And I log out
|
|
|
112 |
And I log in as "manager"
|
|
|
113 |
And I press "Next"
|
|
|
114 |
And I press "Next"
|
|
|
115 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
116 |
And I set the field "I agree to the This privacy policy" to "1"
|
|
|
117 |
And I press "Next"
|
|
|
118 |
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
|
|
119 |
And "Accepted" "text" should exist in the "User One" "table_row"
|
|
|
120 |
And "Pending" "text" should not exist in the "User One" "table_row"
|
|
|
121 |
And "Accepted" "text" should exist in the "Max Manager" "table_row"
|
|
|
122 |
And "Pending" "text" should exist in the "User Two" "table_row"
|
|
|
123 |
And "Accepted" "text" should not exist in the "User Two" "table_row"
|
|
|
124 |
And I click on "Details" "link" in the "User One" "table_row"
|
|
|
125 |
And "Accepted" "text" should exist in the "This site policy" "table_row"
|
|
|
126 |
And "Accepted" "text" should exist in the "This privacy policy" "table_row"
|
|
|
127 |
And I am on site homepage
|
|
|
128 |
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
|
|
129 |
And I click on "Details" "link" in the "User Two" "table_row"
|
|
|
130 |
And "Pending" "text" should exist in the "This site policy" "table_row"
|
|
|
131 |
And "Pending" "text" should exist in the "This privacy policy" "table_row"
|
|
|
132 |
|
|
|
133 |
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript off
|
|
|
134 |
Given the following "role capability" exists:
|
|
|
135 |
| role | manager |
|
|
|
136 |
| tool/policy:acceptbehalf | allow |
|
|
|
137 |
And I log in as "admin"
|
|
|
138 |
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
|
|
139 |
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
|
|
|
140 |
And I press "Continue"
|
|
|
141 |
And I log out
|
|
|
142 |
When I log in as "manager"
|
|
|
143 |
And I press "Next"
|
|
|
144 |
And I press "Next"
|
|
|
145 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
146 |
And I set the field "I agree to the This privacy policy" to "1"
|
|
|
147 |
And I press "Next"
|
|
|
148 |
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
|
|
149 |
And I click on "Accept This site policy" "link" in the "User One" "table_row"
|
|
|
150 |
Then I should see "Accepting policy"
|
|
|
151 |
And I should see "User One"
|
|
|
152 |
And I should see "This site policy"
|
|
|
153 |
And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."
|
|
|
154 |
And I set the field "Remarks" to "Consent received from a parent"
|
|
|
155 |
And I press "Give consent"
|
|
|
156 |
And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"
|
|
|
157 |
And "Pending" "text" should exist in the "User One" "table_row"
|
|
|
158 |
And I click on "Details" "link" in the "User One" "table_row"
|
|
|
159 |
And "Accepted on user's behalf" "text" should exist in the "This site policy" "table_row"
|
|
|
160 |
And "Max Manager" "link" should exist in the "This site policy" "table_row"
|
|
|
161 |
And "Consent received from a parent" "text" should exist in the "This site policy" "table_row"
|
|
|
162 |
And "Pending" "text" should exist in the "This privacy policy" "table_row"
|
|
|
163 |
|
|
|
164 |
@javascript
|
|
|
165 |
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript on
|
|
|
166 |
Given the following "role capability" exists:
|
|
|
167 |
| role | manager |
|
|
|
168 |
| tool/policy:acceptbehalf | allow |
|
|
|
169 |
And I log in as "admin"
|
|
|
170 |
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
|
|
171 |
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
|
|
|
172 |
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
|
|
|
173 |
And I press "Activate"
|
|
|
174 |
And I log out
|
|
|
175 |
When I log in as "manager"
|
|
|
176 |
And I press "Next"
|
|
|
177 |
And I press "Next"
|
|
|
178 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
179 |
And I set the field "I agree to the This privacy policy" to "1"
|
|
|
180 |
And I press "Next"
|
|
|
181 |
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
|
|
182 |
And I click on "Accept This site policy" "link" in the "User One" "table_row"
|
|
|
183 |
Then I should see "Give consent"
|
|
|
184 |
And I should see "User One"
|
|
|
185 |
And I should see "This site policy"
|
|
|
186 |
And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."
|
|
|
187 |
And I set the field "Remarks" to "Consent received from a parent"
|
|
|
188 |
And I press "Give consent"
|
|
|
189 |
And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"
|
|
|
190 |
And "Pending" "text" should exist in the "User One" "table_row"
|
|
|
191 |
And I click on "Details" "link" in the "User One" "table_row"
|
|
|
192 |
And "Accepted on user's behalf" "text" should exist in the "This site policy" "table_row"
|
|
|
193 |
And "Max Manager" "link" should exist in the "This site policy" "table_row"
|
|
|
194 |
And "Consent received from a parent" "text" should exist in the "This site policy" "table_row"
|
|
|
195 |
And "Pending" "text" should exist in the "This privacy policy" "table_row"
|
|
|
196 |
|
|
|
197 |
Scenario: Policies and agreements profile link visible for current user
|
|
|
198 |
Given I log in as "user1"
|
|
|
199 |
And I press "Next"
|
|
|
200 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
201 |
And I press "Next"
|
|
|
202 |
When I follow "Profile" in the user menu
|
|
|
203 |
# User can see his own agreements link in the profile.
|
|
|
204 |
Then I should see "Policies and agreements"
|
|
|
205 |
And I follow "Policies and agreements"
|
|
|
206 |
And "Accepted" "text" should exist in the "This site policy" "table_row"
|
|
|
207 |
# User can't see agreements link in other user profiles.
|
|
|
208 |
And I am on "Course1" course homepage
|
|
|
209 |
And I navigate to course participants
|
|
|
210 |
And I follow "User Two"
|
|
|
211 |
And I should not see "Policies and agreements"
|
|
|
212 |
|
|
|
213 |
Scenario: Policies and agreements profile link visible also for users who can access on behalf of others
|
|
|
214 |
Given the following "role capability" exists:
|
|
|
215 |
| role | manager |
|
|
|
216 |
| tool/policy:acceptbehalf | allow |
|
|
|
217 |
And I log in as "manager"
|
|
|
218 |
And I press "Next"
|
|
|
219 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
220 |
And I press "Next"
|
|
|
221 |
# User can see agreements link in other user profiles because has the capability for accepting on behalf of them.
|
|
|
222 |
When I am on "Course1" course homepage
|
|
|
223 |
And I navigate to course participants
|
|
|
224 |
And I follow "User Two"
|
|
|
225 |
Then I should see "Policies and agreements"
|
|
|
226 |
|
|
|
227 |
Scenario: Agree on behalf of another user as an admin who is logged in as a manager
|
|
|
228 |
Given the following "role capability" exists:
|
|
|
229 |
| role | manager |
|
|
|
230 |
| tool/policy:acceptbehalf | allow |
|
|
|
231 |
When I log in as "manager"
|
|
|
232 |
And I press "Next"
|
|
|
233 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
234 |
And I press "Next"
|
|
|
235 |
And I log out
|
|
|
236 |
And I am on the "manager" "user > profile" page logged in as "admin"
|
|
|
237 |
And I follow "Log in as"
|
|
|
238 |
And I press "Continue"
|
|
|
239 |
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
|
|
240 |
And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"
|
|
|
241 |
And I click on "Accept This site policy" "link" in the "User One" "table_row"
|
|
|
242 |
Then I should see "Accepting policy"
|
|
|
243 |
And I should see "User One"
|
|
|
244 |
And I should see "This site policy"
|
|
|
245 |
And I should see "I acknowledge that I have received a request to give consent on behalf of the above user(s)."
|
|
|
246 |
And I set the field "Remarks" to "Consent received from a parent"
|
|
|
247 |
And I press "Give consent"
|
|
|
248 |
And "Accepted on user's behalf" "text" should exist in the "User One" "table_row"
|
|
|
249 |
And "Max Manager" "link" should not exist in the "User One" "table_row"
|
|
|
250 |
And "Admin User" "link" should exist in the "User One" "table_row"
|
|
|
251 |
And "Consent received from a parent" "text" should exist in the "User One" "table_row"
|
|
|
252 |
And "Pending" "text" should exist in the "User Two" "table_row"
|
|
|
253 |
|
|
|
254 |
@javascript
|
|
|
255 |
Scenario: Bulk agree on behalf of another users as a manager, multiple policies, javascript on
|
|
|
256 |
Given the following "role capability" exists:
|
|
|
257 |
| role | manager |
|
|
|
258 |
| tool/policy:acceptbehalf | allow |
|
|
|
259 |
And I log in as "admin"
|
|
|
260 |
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
|
|
261 |
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
|
|
|
262 |
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
|
|
|
263 |
And I press "Activate"
|
|
|
264 |
And I log out
|
|
|
265 |
When I log in as "manager"
|
|
|
266 |
And I press "Next"
|
|
|
267 |
And I press "Next"
|
|
|
268 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
269 |
And I set the field "I agree to the This privacy policy" to "1"
|
|
|
270 |
And I press "Next"
|
|
|
271 |
And I navigate to "Users > Privacy and policies > User agreements" in site administration
|
|
|
272 |
And I click on "Select" "checkbox" in the "User One" "table_row"
|
|
|
273 |
And I press "Consent"
|
|
|
274 |
And I should see "Accepting policy"
|
|
|
275 |
And I should see "One"
|
|
|
276 |
And I click on "Cancel" "button" in the "Accepting policy" "dialogue"
|
|
|
277 |
And I should not see "Accepting policy"
|
|
|
278 |
And I click on "Select" "checkbox" in the "User Two" "table_row"
|
|
|
279 |
And I press "Consent"
|
|
|
280 |
And I should see "Accepting policy"
|
|
|
281 |
And I should see "User One, User Two"
|
|
|
282 |
When I press "Give consent"
|
|
|
283 |
Then "Accepted on user's behalf" "text" should exist in the "User One" "table_row"
|
|
|
284 |
And "Accepted on user's behalf" "text" should exist in the "User Two" "table_row"
|
|
|
285 |
|
|
|
286 |
Scenario: View acceptances made by users on their own after inactivating a policy
|
|
|
287 |
Given I log in as "user1"
|
|
|
288 |
And I should see "This site policy"
|
|
|
289 |
And I should not see "Course overview"
|
|
|
290 |
And I press "Next"
|
|
|
291 |
And I set the field "I agree to the This site policy" to "1"
|
|
|
292 |
And I press "Next"
|
|
|
293 |
And I should see "Calendar"
|
|
|
294 |
And I log out
|
|
|
295 |
And I log in as "admin"
|
|
|
296 |
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
|
|
297 |
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
|
|
|
298 |
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
|
|
|
299 |
And I press "Continue"
|
|
|
300 |
And I click on "Set status to \"Inactive\"" "link" in the "This privacy policy" "table_row"
|
|
|
301 |
And I press "Continue"
|
|
|
302 |
And I log out
|
|
|
303 |
When I log in as "user1"
|
|
|
304 |
Then I should see "Calendar"
|