2 Feature: User must accept policy managed by this plugin when logging in and signing up
3 In order to record user agreement to use the site
5 I need to be able to accept site policy during sign up
7 Scenario: Accept policy on sign up, no site policy
8 Given the following config values are set as admin:
9 | registerauth | email |
10 | passwordpolicy | 0 |
11 | sitepolicyhandler | tool_policy |
12 And I am on site homepage
14 When I press "Create new account"
15 Then I should not see "I understand and agree"
16 And I set the following fields to these values:
19 | Email address | user1@address.invalid |
20 | Email (again) | user1@address.invalid |
21 | First name | User1 |
23 And I press "Create my new account"
24 And I should see "Confirm your account"
25 And I should see "An email should have been sent to your address at user1@address.invalid"
26 And I confirm email for "user1"
27 And I should see "Thanks, User1 L1"
28 And I should see "Your registration has been confirmed"
29 And I open my profile in edit mode
30 And the field "First name" matches value "User1"
32 # Confirm that user can login and browse the site (edit their profile).
33 And I log in as "user1"
34 And I open my profile in edit mode
35 And the field "First name" matches value "User1"
37 Scenario: Accept policy on sign up, only draft policy
38 Given the following config values are set as admin:
39 | registerauth | email |
40 | passwordpolicy | 0 |
41 | sitepolicyhandler | tool_policy |
42 And the following policies exist:
43 | Policy | Name | Revision | Content | Summary | Status |
44 | P1 | This site policy | | full text1 | short text1 | draft |
45 | P1 | This privacy policy | | full text2 | short text2 | draft |
46 And I am on site homepage
48 When I press "Create new account"
49 Then I should not see "I understand and agree"
50 And I set the following fields to these values:
53 | Email address | user1@address.invalid |
54 | Email (again) | user1@address.invalid |
55 | First name | User1 |
57 And I press "Create my new account"
58 And I should see "Confirm your account"
59 And I should see "An email should have been sent to your address at user1@address.invalid"
60 And I confirm email for "user1"
61 And I should see "Thanks, User1 L1"
62 And I should see "Your registration has been confirmed"
63 And I open my profile in edit mode
64 And the field "First name" matches value "User1"
66 # Confirm that user can login and browse the site (edit their profile).
67 And I log in as "user1"
68 And I open my profile in edit mode
69 And the field "First name" matches value "User1"
71 Scenario: Accept policy on sign up, one policy
72 Given the following config values are set as admin:
73 | registerauth | email |
74 | passwordpolicy | 0 |
75 | sitepolicyhandler | tool_policy |
76 Given the following policies exist:
77 | Policy | Name | Revision | Content | Summary | Status |
78 | P1 | This site policy | | full text1 | short text1 | archived |
79 | P1 | This site policy | | full text2 | short text2 | active |
80 | P1 | This site policy | | full text3 | short text3 | draft |
81 And I am on site homepage
83 When I press "Create new account"
84 Then I should see "This site policy" in the "region-main" "region"
85 And I should see "short text2"
86 And I should see "full text2"
88 And I should see "Please agree to the following policies"
89 And I should see "This site policy" in the "region-main" "region"
90 And I should see "short text2"
91 And I should not see "full text2"
92 And I set the field "I agree to the This site policy" to "1"
94 And I should not see "I understand and agree"
95 And I set the following fields to these values:
98 | Email address | user1@address.invalid |
99 | Email (again) | user1@address.invalid |
100 | First name | User1 |
102 And I press "Create my new account"
103 And I should see "Confirm your account"
104 And I should see "An email should have been sent to your address at user1@address.invalid"
105 And I confirm email for "user1"
106 And I should see "Thanks, User1 L1"
107 And I should see "Your registration has been confirmed"
108 And I open my profile in edit mode
109 And the field "First name" matches value "User1"
111 # Confirm that user can login and browse the site.
112 And I log in as "user1"
113 And I follow "Profile" in the user menu
114 # User can see his own agreements in the profile.
115 And I follow "Policies and agreements"
116 And "Agreed" "icon" should exist in the "This site policy" "table_row"
119 Scenario: Accept policy on sign up, multiple policies
120 Given the following config values are set as admin:
121 | registerauth | email |
122 | passwordpolicy | 0 |
123 | sitepolicyhandler | tool_policy |
124 Given the following policies exist:
125 | Name | Type | Revision | Content | Summary | Status | Audience |
126 | This site policy | 0 | | full text2 | short text2 | active | all |
127 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
128 | This guests policy | 0 | | full text4 | short text4 | active | guest |
129 And I am on site homepage
130 And I follow "Log in"
131 When I press "Create new account"
132 Then I should see "This site policy" in the "region-main" "region"
133 And I should see "short text2"
134 And I should see "full text2"
136 And I should see "This privacy policy" in the "region-main" "region"
137 And I should see "short text3"
138 And I should see "full text3"
140 And I should see "Please agree to the following policies"
141 And I should see "This site policy" in the "region-main" "region"
142 And I should see "short text2"
143 And I should not see "full text2"
144 And I should see "This privacy policy" in the "region-main" "region"
145 And I should see "short text3"
146 And I should not see "full text3"
147 And I should not see "This guests policy" in the "region-main" "region"
148 And I should not see "short text4"
149 And I should not see "full text4"
150 And I set the field "I agree to the This site policy" to "1"
151 And I set the field "I agree to the This privacy policy" to "1"
153 And I should not see "I understand and agree"
154 And I set the following fields to these values:
157 | Email address | user1@address.invalid |
158 | Email (again) | user1@address.invalid |
159 | First name | User1 |
161 And I press "Create my new account"
162 And I should see "Confirm your account"
163 And I should see "An email should have been sent to your address at user1@address.invalid"
164 And I confirm email for "user1"
165 And I should see "Thanks, User1 L1"
166 And I should see "Your registration has been confirmed"
167 And I open my profile in edit mode
168 And the field "First name" matches value "User1"
170 # Confirm that user can login and browse the site.
171 And I log in as "user1"
172 And I follow "Profile" in the user menu
173 # User can see his own agreements in the profile.
174 And I follow "Policies and agreements"
175 And "Agreed" "icon" should exist in the "This site policy" "table_row"
176 And "Agreed" "icon" should exist in the "This privacy policy" "table_row"
177 And I should not see "This guests policy"
180 Scenario: Accept policy on sign up and age verification
181 Given the following config values are set as admin:
182 | registerauth | email |
183 | passwordpolicy | 0 |
184 | sitepolicyhandler | tool_policy |
185 | agedigitalconsentverification | 1 |
186 Given the following policies exist:
187 | Name | Revision | Content | Summary | Status |
188 | This site policy | | full text2 | short text2 | active |
189 And I am on site homepage
190 And I follow "Log in"
191 When I press "Create new account"
192 Then I should see "Age and location verification"
193 And I set the field "What is your age?" to "16"
194 And I set the field "In which country do you live?" to "DZ"
195 And I press "Proceed"
196 And I should see "This site policy"
197 And I should see "short text2"
198 And I should see "full text2"
200 And I should see "Please agree to the following policies"
201 And I should see "This site policy"
202 And I should see "short text2"
203 And I should not see "full text2"
204 And I set the field "I agree to the This site policy" to "1"
206 And I should not see "I understand and agree"
207 And I set the following fields to these values:
210 | Email address | user1@address.invalid |
211 | Email (again) | user1@address.invalid |
212 | First name | User1 |
214 And I press "Create my new account"
215 And I should see "Confirm your account"
216 And I should see "An email should have been sent to your address at user1@address.invalid"
217 And I confirm email for "user1"
218 And I should see "Thanks, User1 L1"
219 And I should see "Your registration has been confirmed"
220 And I open my profile in edit mode
221 And the field "First name" matches value "User1"
223 # Confirm that user can login and browse the site.
224 And I log in as "user1"
225 And I follow "Profile" in the user menu
226 # User can see his own agreements in the profile.
227 And I follow "Policies and agreements"
228 And "Agreed" "icon" should exist in the "This site policy" "table_row"
231 Scenario: Accept policy on sign up, do not accept all policies
232 Given the following config values are set as admin:
233 | registerauth | email |
234 | passwordpolicy | 0 |
235 | sitepolicyhandler | tool_policy |
236 And the following policies exist:
237 | Name | Type | Revision | Content | Summary | Status | Audience |
238 | This site policy | 0 | | full text2 | short text2 | active | all |
239 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
240 And I am on site homepage
241 And I follow "Log in"
242 And I press "Create new account"
243 And I should see "This site policy"
245 And I should see "This privacy policy"
247 And I should see "Please agree to the following policies"
248 And I should see "This site policy"
249 And I should see "This privacy policy"
250 # Confirm that a notification is displayed if none of the policies are accepted.
251 When I set the field "I agree to the This site policy" to "0"
252 And I set the field "I agree to the This privacy policy" to "0"
254 Then I should see "Please agree to the following policies"
255 And I should see "Before continuing you must agree to all these policies."
256 # Confirm that a notification is displayed if only some policies are accepted.
257 When I set the field "I agree to the This site policy" to "1"
258 And I set the field "I agree to the This privacy policy" to "0"
259 Then I should see "Please agree to the following policies"
260 And I should see "Before continuing you must agree to all these policies."
262 Scenario: Accept policy on login, do not accept all policies
263 Given the following config values are set as admin:
264 | registerauth | email |
265 | passwordpolicy | 0 |
266 | sitepolicyhandler | tool_policy |
267 And the following policies exist:
268 | Name | Type | Revision | Content | Summary | Status | Audience |
269 | This site policy | 0 | | full text2 | short text2 | active | all |
270 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
271 And the following "users" exist:
272 | username | firstname | lastname | email |
273 | user1 | User | 1 | user1@example.com |
274 And I log in as "user1"
275 And I should see "This site policy"
277 And I should see "This privacy policy"
279 And I should see "Please agree to the following policies"
280 And I should see "This site policy"
281 And I should see "This privacy policy"
282 # Confirm that a notification is displayed if none of the policies are accepted.
283 When I set the field "I agree to the This site policy" to "0"
284 And I set the field "I agree to the This privacy policy" to "0"
286 Then I should see "Please agree to the following policies"
287 And I should see "Before continuing you must agree to all these policies."
288 # Confirm that a notification is displayed if only some policies are accepted.
289 When I set the field "I agree to the This site policy" to "1"
290 And I set the field "I agree to the This privacy policy" to "0"
291 Then I should see "Please agree to the following policies"
292 And I should see "Before continuing you must agree to all these policies."
293 # Confirm that user can not browse the site (edit their profile).
294 When I follow "Profile" in the user menu
295 Then I should see "Please agree to the following policies"
297 Scenario: Accept policy on login, accept all policies
298 Given the following config values are set as admin:
299 | registerauth | email |
300 | passwordpolicy | 0 |
301 | sitepolicyhandler | tool_policy |
302 And the following policies exist:
303 | Name | Type | Revision | Content | Summary | Status | Audience |
304 | This site policy | 0 | | full text2 | short text2 | active | all |
305 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
306 And the following "users" exist:
307 | username | firstname | lastname | email |
308 | user1 | User | 1 | user1@example.com |
309 And I log in as "user1"
310 And I should see "This site policy"
312 And I should see "This privacy policy"
314 And I should see "Please agree to the following policies"
315 And I should see "This site policy"
316 And I should see "This privacy policy"
317 # User accepts all policies.
318 When I set the field "I agree to the This site policy" to "1"
319 And I set the field "I agree to the This privacy policy" to "1"
321 Then I should not see "Please agree to the following policies"
322 And I should not see "Before continuing you must agree to all these policies."
323 # Confirm that user can login and browse the site (edit their profile).
324 When I open my profile in edit mode
325 Then the field "First name" matches value "User"
327 # Confirm when logging again as user, the policies are not displayed.
328 When I log in as "user1"
329 Then I should not see "This site policy"
330 And I should not see "This privacy policy"
331 And I should not see "Please agree to the following policies"
332 # Confirm that user can login and browse the site (edit their profile).
333 When I open my profile in edit mode
334 Then the field "First name" matches value "User"
336 Scenario: Accept policy on login, accept new policy documents
337 Given the following config values are set as admin:
338 | registerauth | email |
339 | passwordpolicy | 0 |
340 | sitepolicyhandler | tool_policy |
341 And the following policies exist:
342 | Name | Type | Revision | Content | Summary | Status | Audience |
343 | This site policy | 0 | | full text2 | short text2 | active | all |
344 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
345 And the following "users" exist:
346 | username | firstname | lastname | email |
347 | user1 | User | 1 | user1@example.com |
348 And I log in as "user1"
349 And I should see "This site policy"
351 And I should see "This privacy policy"
353 And I should see "Please agree to the following policies"
354 And I should see "This site policy"
355 And I should see "This privacy policy"
356 # User accepts all policies.
357 When I set the field "I agree to the This site policy" to "1"
358 And I set the field "I agree to the This privacy policy" to "1"
360 Then I should not see "Please agree to the following policies"
361 # Confirm that user can login and browse the site (edit their profile).
362 When I open my profile in edit mode
363 Then the field "First name" matches value "User"
365 # Create new policy document.
366 And I log in as "admin"
367 And I navigate to "Manage policies" node in "Site administration > Users > Privacy and policies"
368 And I should see "Policies and agreements"
369 And I should see "New policy"
370 And I follow "New policy"
371 And I set the following fields to these values:
372 | Name | This third parties policy |
373 | Type | Third parties policy |
374 | User consent | All users |
375 | Summary | short text4 |
376 | Full policy | full text4 |
379 Then I should see "Policies and agreements"
380 And I should see "This third parties policy"
382 # Confirm when logging again as user, the new policies are displayed.
383 When I log in as "user1"
384 And I should not see "This site policy"
385 And I should not see "This privacy policy"
386 Then I should see "This third parties policy"
388 And I should see "Please agree to the following policies"
389 And I should see "This third parties policy"
390 And I set the field "This third parties policy" to "1"
392 # Confirm that user can login and browse the site (edit their profile).
393 When I open my profile in edit mode
394 Then the field "First name" matches value "User"
396 Scenario: Accept policy on login, accept new policy version
397 Given the following config values are set as admin:
398 | registerauth | email |
399 | passwordpolicy | 0 |
400 | sitepolicyhandler | tool_policy |
401 And the following policies exist:
402 | Name | Type | Revision | Content | Summary | Status | Audience |
403 | This site policy | 0 | | full text2 | short text2 | active | all |
404 And the following "users" exist:
405 | username | firstname | lastname | email |
406 | user1 | User | 1 | user1@example.com |
407 And I log in as "user1"
408 And I should see "This site policy"
410 And I should see "Please agree to the following policies"
411 And I should see "This site policy"
412 # User accepts policy.
413 When I set the field "I agree to the This site policy" to "1"
415 Then I should not see "Please agree to the following policies"
416 # Confirm that user can login and browse the site (edit their profile).
417 When I open my profile in edit mode
418 Then the field "First name" matches value "User"
420 # Create new version of the policy document.
421 And I log in as "admin"
422 And I navigate to "Manage policies" node in "Site administration > Users > Privacy and policies"
423 When I follow "Actions"
424 Then I should see "View"
425 And I should see "Edit"
426 And I should see "Set status to \"Inactive\""
428 Then I should see "Editing policy"
429 And I set the field "Name" to "This site policy new version"
430 And I set the field "Summary" to "short text2 new version"
431 And I set the field "Full policy" to "full text2 new version"
434 # Confirm that the user has to agree to the new version of the policy.
435 When I log in as "user1"
436 Then I should see "This site policy new version"
437 And I should see "short text2 new version"
438 And I should see "full text2 new version"
440 Then I should see "Please agree to the following policies"
441 And I should see "This site policy new version"
442 And I should see "short text2 new version"
443 # User accepts policy.
444 And I set the field "I agree to the This site policy new version" to "1"
446 Then I should not see "Please agree to the following policies"
447 # Confirm that user can login and browse the site (edit their profile).
448 When I open my profile in edit mode
449 Then the field "First name" matches value "User"
452 Scenario: Accept policy on login as guest
453 Given the following config values are set as admin:
454 | registerauth | email |
455 | passwordpolicy | 0 |
456 | sitepolicyhandler | tool_policy |
457 And the following policies exist:
458 | Name | Type | Revision | Content | Summary | Status | Audience |
459 | This site policy | 0 | | full text2 | short text2 | active | all |
460 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
461 | This guests policy | 0 | | full text4 | short text4 | active | guest |
462 And I am on site homepage
463 And I follow "Log in"
464 When I press "Log in as a guest"
465 Then I should see "If you continue browsing this website, you agree to our policies"
466 # Confirm when navigating, the pop-up policies are displayed.
468 Then I should see "If you continue browsing this website, you agree to our policies"
469 And I should see "This site policy"
470 And I should see "This guests policy"
471 And I should not see "This privacy policy"
472 # Confirm when clicking on the policy links, the policy content is displayed.
473 When I click on "This site policy" "link"
474 Then I should see "full text2"
475 And I click on "Close" "button"
476 And I should not see "full text2"
477 When I click on "This guests policy" "link"
478 Then I should see "full text4"
479 And I click on "Close" "button"
480 And I should not see "full text4"
481 # Confirm when agreeing to policies the pop-up is no longer displayed.
482 When I follow "Continue"
483 Then I should not see "If you continue browsing this website, you agree to our policies"
485 Scenario: Accept policy on sign up, after completing sign up attempt to create another account
486 Given the following config values are set as admin:
487 | registerauth | email |
488 | passwordpolicy | 0 |
489 | sitepolicyhandler | tool_policy |
490 Given the following policies exist:
491 | Name | Type | Revision | Content | Summary | Status | Audience |
492 | This site policy | 0 | | full text2 | short text2 | active | all |
493 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
494 | This guests policy | 0 | | full text4 | short text4 | active | guest |
495 And I am on site homepage
496 And I follow "Log in"
497 When I press "Create new account"
498 Then I should see "This site policy" in the "region-main" "region"
499 And I should see "short text2"
500 And I should see "full text2"
502 Then I should see "This privacy policy" in the "region-main" "region"
503 And I should see "short text3"
504 And I should see "full text3"
506 Then I should see "Please agree to the following policies"
507 And I should see "This site policy" in the "region-main" "region"
508 And I should see "short text2"
509 And I should see "This privacy policy" in the "region-main" "region"
510 And I should see "short text3"
511 And I should not see "This guests policy" in the "region-main" "region"
512 And I should not see "short text4"
513 And I set the field "I agree to the This site policy" to "1"
514 And I set the field "I agree to the This privacy policy" to "1"
516 Then I should not see "I understand and agree"
517 And I should see "New account"
518 And I set the following fields to these values:
521 | Email address | user1@address.invalid |
522 | Email (again) | user1@address.invalid |
523 | First name | User1 |
525 When I press "Create my new account"
526 Then I should see "Confirm your account"
527 And I should see "An email should have been sent to your address at user1@address.invalid"
528 And I follow "Log in"
529 When I press "Create new account"
530 # Confirm that the user can view and accept policies when attempting to create another account.
531 Then I should see "This site policy" in the "region-main" "region"
532 And I should see "short text2"
533 And I should see "full text2"
535 Then I should see "This privacy policy" in the "region-main" "region"
536 And I should see "short text3"
537 And I should see "full text3"
539 Then I should see "Please agree to the following policies"
540 And I should see "This site policy" in the "region-main" "region"
541 And I should see "short text2"
542 And I should not see "full text2"
543 And I should see "This privacy policy" in the "region-main" "region"
544 And I should see "short text3"
545 And I should not see "full text3"
546 And I should not see "This guests policy" in the "region-main" "region"
547 And I should not see "short text4"
548 And I should not see "full text4"
549 And I set the field "I agree to the This site policy" to "1"
550 And I set the field "I agree to the This privacy policy" to "1"
552 Then I should not see "I understand and agree"
553 And I should see "New account"
555 Scenario: Accept policy while being logged in as another user
556 Given the following config values are set as admin:
557 | sitepolicyhandler | tool_policy |
558 And the following policies exist:
559 | Name | Type | Revision | Content | Summary | Status | Audience |
560 | This site policy | 0 | | full text2 | short text2 | active | all |
561 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
562 And the following "users" exist:
563 | username | firstname | lastname | email |
564 | user1 | User | 1 | user1@example.com |
565 When I log in as "admin"
566 And I navigate to "Users > Accounts > Browse list of users" in site administration
567 And I follow "User 1"
568 And I follow "Log in as"
569 Then I should see "You are logged in as User 1"
570 And I press "Continue"
571 And I should see "Please read our This site policy"
573 And I should see "Please read our This privacy policy"
575 And I should see "Viewing this page on behalf of User 1"
576 And I set the field "I agree to the This site policy" to "1"
577 And I set the field "I agree to the This privacy policy" to "1"
580 And I log in as "user1"
581 And I follow "Profile" in the user menu
582 And I follow "Policies and agreements"
583 And "Admin User" "link" should exist in the "This site policy" "table_row"
584 And "Admin User" "link" should exist in the "This privacy policy" "table_row"
586 Scenario: Log in as another user without capability to accept policies on their behalf
587 Given the following config values are set as admin:
588 | sitepolicyhandler | tool_policy |
589 And the following policies exist:
590 | Name | Type | Revision | Content | Summary | Status | Audience |
591 | This site policy | 0 | | full text2 | short text2 | active | all |
592 | This privacy policy | 1 | | full text3 | short text3 | active | loggedin |
593 And the following "users" exist:
594 | username | firstname | lastname | email |
595 | user1 | User | 1 | user1@example.com |
596 | manager | Max | Manager | man@example.com |
597 And the following "role assigns" exist:
598 | user | role | contextlevel | reference |
599 | manager | manager | System | |
600 When I log in as "manager"
603 And I set the field "I agree to the This site policy" to "1"
604 And I set the field "I agree to the This privacy policy" to "1"
606 And I navigate to "Users > Accounts > Browse list of users" in site administration
607 And I follow "User 1"
608 And I follow "Log in as"
609 Then I should see "You are logged in as User 1"
610 And I press "Continue"
611 And I should see "Policies and agreements"
612 And I should see "No permission to agree to the policies on behalf of this user"
613 And I should see "Sorry, you do not have the required permission to agree to the following policies on behalf of User 1"
615 Scenario: Accept policy on sign up as a guest, one policy
616 Given the following config values are set as admin:
617 | registerauth | email |
618 | passwordpolicy | 0 |
619 | sitepolicyhandler | tool_policy |
620 Given the following policies exist:
621 | Policy | Name | Revision | Content | Summary | Status |
622 | P1 | This site policy | | full text1 | short text1 | archived |
623 | P1 | This site policy | | full text2 | short text2 | active |
624 | P1 | This site policy | | full text3 | short text3 | draft |
625 And I am on site homepage
626 And I follow "Log in"
627 # First log in as a guest
628 And I press "Log in as a guest"
630 And I follow "Log in"
631 When I press "Create new account"
632 Then I should see "This site policy"
633 And I should see "short text2"
634 And I should see "full text2"
636 And I should see "Please agree to the following policies"
637 And I should see "This site policy"
638 And I should see "short text2"
639 And I should not see "full text2"
640 And I set the field "I agree to the This site policy" to "1"
642 And I should not see "I understand and agree"
643 And I set the following fields to these values:
646 | Email address | user1@address.invalid |
647 | Email (again) | user1@address.invalid |
648 | First name | User1 |
650 And I press "Create my new account"
651 And I should see "Confirm your account"
652 And I should see "An email should have been sent to your address at user1@address.invalid"
653 And I confirm email for "user1"
654 And I should see "Thanks, User1 L1"
655 And I should see "Your registration has been confirmed"
656 And I open my profile in edit mode
657 And the field "First name" matches value "User1"
659 # Confirm that user can login and browse the site.
660 And I log in as "user1"
661 And I follow "Profile" in the user menu
662 # User can see his own agreements in the profile.
663 And I follow "Policies and agreements"
664 And "Agreed" "icon" should exist in the "This site policy" "table_row"