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
@tool @tool_policy
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
4
  As a user
5
  I need to be able to accept site policy during sign up
6
 
1441 ariadna 7
  Scenario: Accept policy on sign up manage by plugin, no site policy
1 efrain 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
13
    And I follow "Log in"
14
    When I click on "Create new account" "link"
15
    Then I should not see "I understand and agree"
16
    And I set the following fields to these values:
17
      | Username      | user1                 |
18
      | Password      | user1                 |
1441 ariadna 19
      | Email address | user1@example.com     |
20
      | Email (again) | user1@example.com     |
1 efrain 21
      | First name    | User1                 |
22
      | Last name     | L1                    |
23
    And I press "Create my new account"
24
    And I should see "Confirm your account"
1441 ariadna 25
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 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"
31
    And I log out
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"
36
 
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
47
    And I follow "Log in"
48
    When I click on "Create new account" "link"
49
    Then I should not see "I understand and agree"
50
    And I set the following fields to these values:
51
      | Username      | user1                 |
52
      | Password      | user1                 |
1441 ariadna 53
      | Email address | user1@example.com |
54
      | Email (again) | user1@example.com |
1 efrain 55
      | First name    | User1                 |
56
      | Last name     | L1                    |
57
    And I press "Create my new account"
58
    And I should see "Confirm your account"
1441 ariadna 59
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 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"
65
    And I log out
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"
70
 
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
82
    And I follow "Log in"
83
    When I click on "Create new account" "link"
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"
87
    And I press "Next"
1441 ariadna 88
    And I should see "Please agree to the following policies:"
1 efrain 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"
1441 ariadna 92
    And I set the field "I agree to the This site policy." to "1"
1 efrain 93
    And I press "Next"
94
    And I should not see "I understand and agree"
95
    And I set the following fields to these values:
96
      | Username      | user1                 |
97
      | Password      | user1                 |
1441 ariadna 98
      | Email address | user1@example.com |
99
      | Email (again) | user1@example.com |
1 efrain 100
      | First name    | User1                 |
101
      | Last name     | L1                    |
102
    And I press "Create my new account"
103
    And I should see "Confirm your account"
1441 ariadna 104
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 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"
110
    And I log out
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 "Accepted" "text" should exist in the "This site policy" "table_row"
117
    And I log out
118
 
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 click on "Create new account" "link"
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"
135
    And I press "Next"
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"
139
    And I press "Next"
1441 ariadna 140
    And I should see "Please agree to the following policies:"
1 efrain 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"
1441 ariadna 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"
1 efrain 152
    And I press "Next"
153
    And I should not see "I understand and agree"
154
    And I set the following fields to these values:
155
      | Username      | user1                 |
156
      | Password      | user1                 |
1441 ariadna 157
      | Email address | user1@example.com |
158
      | Email (again) | user1@example.com |
1 efrain 159
      | First name    | User1                 |
160
      | Last name     | L1                    |
161
    And I press "Create my new account"
162
    And I should see "Confirm your account"
1441 ariadna 163
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 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"
169
    And I log out
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 "Accepted" "text" should exist in the "This site policy" "table_row"
176
    And "Accepted" "text" should exist in the "This privacy policy" "table_row"
177
    And I should not see "This guests policy"
178
    And I log out
179
 
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 click on "Create new account" "link"
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"
199
    And I press "Next"
1441 ariadna 200
    And I should see "Please agree to the following policies:"
1 efrain 201
    And I should see "This site policy"
202
    And I should see "short text2"
203
    And I should not see "full text2"
1441 ariadna 204
    And I set the field "I agree to the This site policy." to "1"
1 efrain 205
    And I press "Next"
206
    And I should not see "I understand and agree"
207
    And I set the following fields to these values:
208
      | Username      | user1                 |
209
      | Password      | user1                 |
1441 ariadna 210
      | Email address | user1@example.com |
211
      | Email (again) | user1@example.com |
1 efrain 212
      | First name    | User1                 |
213
      | Last name     | L1                    |
214
    And I press "Create my new account"
215
    And I should see "Confirm your account"
1441 ariadna 216
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 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"
222
    And I log out
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 "Accepted" "text" should exist in the "This site policy" "table_row"
229
    And I log out
230
 
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 click on "Create new account" "link"
243
    And I should see "This site policy"
244
    And I press "Next"
245
    And I should see "This privacy policy"
246
    And I press "Next"
1441 ariadna 247
    And I should see "Please agree to the following policies:"
1 efrain 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.
1441 ariadna 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"
1 efrain 253
    And I press "Next"
1441 ariadna 254
    Then I should see "Please agree to the following policies:"
1 efrain 255
    And I should see "Before continuing you need to acknowledge all these policies."
256
    # Confirm that a notification is displayed if only some policies are accepted.
1441 ariadna 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:"
1 efrain 260
    And I should see "Before continuing you need to acknowledge all these policies."
261
 
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"
276
    And I press "Next"
277
    And I should see "This privacy policy"
278
    And I press "Next"
1441 ariadna 279
    And I should see "Please agree to the following policies:"
1 efrain 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.
1441 ariadna 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"
1 efrain 285
    And I press "Next"
1441 ariadna 286
    Then I should see "Please agree to the following policies:"
1 efrain 287
    And I should see "Before continuing you need to acknowledge all these policies."
288
    # Confirm that a notification is displayed if only some policies are accepted.
1441 ariadna 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:"
1 efrain 292
    And I should see "Before continuing you need to acknowledge all these policies."
293
 
294
  Scenario: Accept policy on login, accept all policies
295
    Given the following config values are set as admin:
296
      | registerauth    | email |
297
      | passwordpolicy  | 0     |
298
      | sitepolicyhandler | tool_policy |
299
    And the following policies exist:
300
      | Name                | Type | Revision | Content    | Summary     | Status   | Audience |
301
      | This site policy    | 0    |          | full text2 | short text2 | active   | all      |
302
      | This privacy policy | 1    |          | full text3 | short text3 | active   | loggedin |
303
    And the following "users" exist:
304
      | username | firstname | lastname | email            |
305
      | user1    | User      | 1        | user1@example.com    |
306
    And I log in as "user1"
307
    And I should see "This site policy"
308
    And I press "Next"
309
    And I should see "This privacy policy"
310
    And I press "Next"
1441 ariadna 311
    And I should see "Please agree to the following policies:"
1 efrain 312
    And I should see "This site policy"
313
    And I should see "This privacy policy"
314
    # User accepts all policies.
1441 ariadna 315
    When I set the field "I agree to the This site policy." to "1"
316
    And I set the field "I agree to the This privacy policy." to "1"
1 efrain 317
    And I press "Next"
1441 ariadna 318
    Then I should not see "Please agree to the following policies:"
1 efrain 319
    And I should not see "Before continuing you need to acknowledge all these policies."
320
    # Confirm that user can login and browse the site (edit their profile).
321
    When I open my profile in edit mode
322
    Then the field "First name" matches value "User"
323
    And I log out
324
    # Confirm when logging again as user, the policies are not displayed.
325
    When I log in as "user1"
326
    Then I should not see "This site policy"
327
    And I should not see "This privacy policy"
1441 ariadna 328
    And I should not see "Please agree to the following policies:"
1 efrain 329
    # Confirm that user can login and browse the site (edit their profile).
330
    When I open my profile in edit mode
331
    Then the field "First name" matches value "User"
332
 
333
  Scenario: Accept policy on login, accept new policy documents
334
    Given the following config values are set as admin:
335
      | registerauth    | email |
336
      | passwordpolicy  | 0     |
337
      | sitepolicyhandler | tool_policy |
338
    And the following policies exist:
339
      | Name                | Type | Revision | Content    | Summary     | Status   | Audience |
340
      | This site policy    | 0    |          | full text2 | short text2 | active   | all      |
341
      | This privacy policy | 1    |          | full text3 | short text3 | active   | loggedin |
342
    And the following "users" exist:
343
      | username | firstname | lastname | email            |
344
      | user1    | User      | 1        | user1@example.com    |
345
    And I log in as "user1"
346
    And I should see "This site policy"
347
    And I press "Next"
348
    And I should see "This privacy policy"
349
    And I press "Next"
1441 ariadna 350
    And I should see "Please agree to the following policies:"
1 efrain 351
    And I should see "This site policy"
352
    And I should see "This privacy policy"
353
    # User accepts all policies.
1441 ariadna 354
    When I set the field "I agree to the This site policy." to "1"
355
    And I set the field "I agree to the This privacy policy." to "1"
1 efrain 356
    And I press "Next"
1441 ariadna 357
    Then I should not see "Please agree to the following policies:"
1 efrain 358
    # Confirm that user can login and browse the site (edit their profile).
359
    When I open my profile in edit mode
360
    Then the field "First name" matches value "User"
361
    And I log out
362
    # Create new policy document.
363
    And I log in as "admin"
364
    And I navigate to "Users > Privacy and policies > Manage policies" in site administration
365
    And I should see "Policies and agreements"
366
    And I should see "New policy"
367
    And I follow "New policy"
368
    And I set the following fields to these values:
369
      | Name          | This third parties policy |
370
      | Type          | Third parties policy      |
371
      | User consent  | All users                 |
372
      | Summary       | short text4               |
373
      | Full policy   | full text4                |
374
      | Active        | 1                    |
375
    When I press "Save"
376
    Then I should see "Policies and agreements"
377
    And I should see "This third parties policy"
378
    And I log out
379
    # Confirm when logging again as user, the new policies are displayed.
380
    When I log in as "user1"
381
    And I should not see "This site policy"
382
    And I should not see "This privacy policy"
383
    Then I should see "This third parties policy"
384
    And I press "Next"
1441 ariadna 385
    And I should see "Please agree to the following policies:"
1 efrain 386
    And I should see "This third parties policy"
387
    And I set the field "This third parties policy" to "1"
388
    And I press "Next"
389
    # Confirm that user can login and browse the site (edit their profile).
390
    When I open my profile in edit mode
391
    Then the field "First name" matches value "User"
392
 
393
  Scenario: Accept policy on login, accept new policy version
394
    Given the following config values are set as admin:
395
      | registerauth    | email |
396
      | passwordpolicy  | 0     |
397
      | sitepolicyhandler | tool_policy |
398
    And the following policies exist:
399
      | Name                | Type | Revision | Content    | Summary     | Status   | Audience |
400
      | This site policy    | 0    |          | full text2 | short text2 | active   | all      |
401
    And the following "users" exist:
402
      | username | firstname | lastname | email            |
403
      | user1    | User      | 1        | user1@example.com    |
404
    And I log in as "user1"
405
    And I should see "This site policy"
406
    And I press "Next"
1441 ariadna 407
    And I should see "Please agree to the following policies:"
1 efrain 408
    And I should see "This site policy"
409
    # User accepts policy.
1441 ariadna 410
    When I set the field "I agree to the This site policy." to "1"
1 efrain 411
    And I press "Next"
1441 ariadna 412
    Then I should not see "Please agree to the following policies:"
1 efrain 413
    # Confirm that user can login and browse the site (edit their profile).
414
    When I open my profile in edit mode
415
    Then the field "First name" matches value "User"
416
    And I log out
417
    # Create new version of the policy document.
418
    And I log in as "admin"
419
    And I navigate to "Users > Privacy and policies > Manage policies" in site administration
420
    # Menu is already open because javascript is disabled.
421
    Then I should see "View"
422
    And I should see "Edit"
423
    And I should see "Set status to \"Inactive\""
424
    When I follow "Edit"
425
    Then I should see "Editing policy"
426
    And I set the field "Name" to "This site policy new version"
427
    And I set the field "Summary" to "short text2 new version"
428
    And I set the field "Full policy" to "full text2 new version"
429
    And I press "Save"
430
    And I log out
431
    # Confirm that the user has to agree to the new version of the policy.
432
    When I log in as "user1"
433
    Then I should see "This site policy new version"
434
    And I should see "short text2 new version"
435
    And I should see "full text2 new version"
436
    When I press "Next"
1441 ariadna 437
    Then I should see "Please agree to the following policies:"
1 efrain 438
    And I should see "This site policy new version"
439
    And I should see "short text2 new version"
440
    # User accepts policy.
1441 ariadna 441
    And I set the field "I agree to the This site policy new version." to "1"
1 efrain 442
    When I press "Next"
1441 ariadna 443
    Then I should not see "Please agree to the following policies:"
1 efrain 444
    # Confirm that user can login and browse the site (edit their profile).
445
    When I open my profile in edit mode
446
    Then the field "First name" matches value "User"
447
 
448
  @javascript
449
  Scenario: Accept policy on login as guest
450
    Given the following config values are set as admin:
451
      | registerauth    | email |
452
      | passwordpolicy  | 0     |
453
      | sitepolicyhandler | tool_policy |
454
    And the following policies exist:
455
      | Name                | Type | Revision | Content    | Summary     | Status   | Audience |
456
      | This site policy    | 0    |          | full text2 | short text2 | active   | all      |
457
      | This privacy policy | 1    |          | full text3 | short text3 | active   | loggedin |
458
      | This guests policy  | 0    |          | full text4 | short text4 | active   | guest    |
459
    And I am on site homepage
460
    And I change window size to "large"
461
    And I follow "Log in"
462
    When I press "Access as a guest"
463
    Then I should see "If you continue browsing this website, you agree to our policies"
464
    # Confirm when navigating, the pop-up policies are displayed.
465
    When I am on the "My courses" page
466
    Then I should see "If you continue browsing this website, you agree to our policies"
467
    And I should see "This site policy"
468
    And I should see "This guests policy"
469
    And I should not see "This privacy policy"
470
    # Confirm when clicking on the policy links, the policy content is displayed.
471
    When I click on "This site policy" "link"
472
    Then I should see "full text2"
473
    And I click on "Close" "button" in the "This site policy" "dialogue"
474
    And I should not see "full text2"
475
    When I click on "This guests policy" "link"
476
    Then I should see "full text4"
477
    And I click on "Close" "button" in the "This guests policy" "dialogue"
478
    And I should not see "full text4"
479
    # Confirm when agreeing to policies the pop-up is no longer displayed.
480
    When I follow "Continue"
481
    Then I should not see "If you continue browsing this website, you agree to our policies"
482
 
483
  Scenario: Accept policy on sign up, after completing sign up attempt to create another account
484
    Given the following config values are set as admin:
485
      | registerauth    | email |
486
      | passwordpolicy  | 0     |
487
      | sitepolicyhandler | tool_policy |
488
    Given the following policies exist:
489
      | Name                | Type | Revision | Content    | Summary     | Status   | Audience |
490
      | This site policy    | 0    |          | full text2 | short text2 | active   | all      |
491
      | This privacy policy | 1    |          | full text3 | short text3 | active   | loggedin |
492
      | This guests policy  | 0    |          | full text4 | short text4 | active   | guest    |
493
    And I am on site homepage
494
    And I follow "Log in"
495
    When I click on "Create new account" "link"
496
    Then I should see "This site policy" in the "region-main" "region"
497
    And I should see "short text2"
498
    And I should see "full text2"
499
    When I press "Next"
500
    Then I should see "This privacy policy" in the "region-main" "region"
501
    And I should see "short text3"
502
    And I should see "full text3"
503
    When I press "Next"
1441 ariadna 504
    Then I should see "Please agree to the following policies:"
1 efrain 505
    And I should see "This site policy" in the "region-main" "region"
506
    And I should see "short text2"
507
    And I should see "This privacy policy" in the "region-main" "region"
508
    And I should see "short text3"
509
    And I should not see "This guests policy" in the "region-main" "region"
510
    And I should not see "short text4"
1441 ariadna 511
    And I set the field "I agree to the This site policy." to "1"
512
    And I set the field "I agree to the This privacy policy." to "1"
1 efrain 513
    When I press "Next"
514
    Then I should not see "I understand and agree"
515
    And I should see "New account"
516
    And I set the following fields to these values:
517
      | Username      | user1                 |
518
      | Password      | user1                 |
1441 ariadna 519
      | Email address | user1@example.com |
520
      | Email (again) | user1@example.com |
1 efrain 521
      | First name    | User1                 |
522
      | Last name     | L1                    |
523
    When I press "Create my new account"
524
    Then I should see "Confirm your account"
1441 ariadna 525
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 526
    And I follow "Log in"
527
    When I click on "Create new account" "link"
528
    # Confirm that the user can view and accept policies when attempting to create another account.
529
    Then I should see "This site policy" in the "region-main" "region"
530
    And I should see "short text2"
531
    And I should see "full text2"
532
    When I press "Next"
533
    Then I should see "This privacy policy" in the "region-main" "region"
534
    And I should see "short text3"
535
    And I should see "full text3"
536
    When I press "Next"
1441 ariadna 537
    Then I should see "Please agree to the following policies:"
1 efrain 538
    And I should see "This site policy" in the "region-main" "region"
539
    And I should see "short text2"
540
    And I should not see "full text2"
541
    And I should see "This privacy policy" in the "region-main" "region"
542
    And I should see "short text3"
543
    And I should not see "full text3"
544
    And I should not see "This guests policy" in the "region-main" "region"
545
    And I should not see "short text4"
546
    And I should not see "full text4"
1441 ariadna 547
    And I set the field "I agree to the This site policy." to "1"
548
    And I set the field "I agree to the This privacy policy." to "1"
1 efrain 549
    When I press "Next"
550
    Then I should not see "I understand and agree"
551
    And I should see "New account"
552
 
553
  Scenario: Accept policy while being logged in as another user
554
    Given the following config values are set as admin:
555
      | sitepolicyhandler | tool_policy |
556
    And the following policies exist:
557
      | Name                | Type | Revision | Content    | Summary     | Status   | Audience |
558
      | This site policy    | 0    |          | full text2 | short text2 | active   | all      |
559
      | This privacy policy | 1    |          | full text3 | short text3 | active   | loggedin |
560
    And the following "users" exist:
561
      | username | firstname | lastname | email            |
562
      | user1    | User      | 1        | user1@example.com    |
563
    When I am on the "user1" "user > profile" page logged in as "admin"
564
    And I follow "Log in as"
565
    Then I should see "You are logged in as User 1"
566
    And I press "Continue"
567
    And I should see "Please read our This site policy"
568
    And I press "Next"
569
    And I should see "Please read our This privacy policy"
570
    And I press "Next"
571
    And I should see "Viewing this page on behalf of User 1"
1441 ariadna 572
    And I set the field "I agree to the This site policy." to "1"
573
    And I set the field "I agree to the This privacy policy." to "1"
1 efrain 574
    And I press "Next"
575
    And I log out
576
    And I log in as "user1"
577
    And I follow "Profile" in the user menu
578
    And I follow "Policies and agreements"
579
    And "Admin User" "link" should exist in the "This site policy" "table_row"
580
    And "Admin User" "link" should exist in the "This privacy policy" "table_row"
581
 
582
  Scenario: Log in as another user without capability to accept policies on their behalf
583
    Given the following config values are set as admin:
584
      | sitepolicyhandler | tool_policy |
585
    And the following policies exist:
586
      | Name                | Type | Revision | Content    | Summary     | Status   | Audience |
587
      | This site policy    | 0    |          | full text2 | short text2 | active   | all      |
588
      | This privacy policy | 1    |          | full text3 | short text3 | active   | loggedin |
589
    And the following "users" exist:
590
      | username | firstname | lastname | email            |
591
      | user1    | User      | 1        | user1@example.com    |
592
      | manager  | Max       | Manager  | man@example.com |
593
    And the following "role assigns" exist:
594
      | user    | role           | contextlevel | reference |
595
      | manager | manager        | System       |           |
596
    When I log in as "manager"
597
    And I press "Next"
598
    And I press "Next"
1441 ariadna 599
    And I set the field "I agree to the This site policy." to "1"
600
    And I set the field "I agree to the This privacy policy." to "1"
1 efrain 601
    And I press "Next"
602
    And I am on the "user1" "user > profile" page
603
    And I follow "Log in as"
604
    Then I should see "You are logged in as User 1"
605
    And I press "Continue"
606
    And I should see "Policies and agreements"
1441 ariadna 607
    And I should see "No permission to agree to the policies on behalf of this user."
1 efrain 608
    And I should see "Sorry, you do not have the required permission to agree to the following policies on behalf of User 1"
609
 
610
  Scenario: Accept policy on sign up as a guest, one policy
611
    Given the following config values are set as admin:
612
      | registerauth    | email |
613
      | passwordpolicy  | 0     |
614
      | sitepolicyhandler | tool_policy |
615
    Given the following policies exist:
616
      | Policy | Name             | Revision | Content    | Summary     | Status   |
617
      | P1     | This site policy |          | full text1 | short text1 | archived |
618
      | P1     | This site policy |          | full text2 | short text2 | active   |
619
      | P1     | This site policy |          | full text3 | short text3 | draft    |
620
    And I am on site homepage
621
    And I follow "Log in"
622
    # First log in as a guest
623
    And I press "Access as a guest"
624
    # Now sign up
625
    And I follow "Log in"
626
    When I click on "Create new account" "link"
627
    Then I should see "This site policy"
628
    And I should see "short text2"
629
    And I should see "full text2"
630
    And I press "Next"
1441 ariadna 631
    And I should see "Please agree to the following policies:"
1 efrain 632
    And I should see "This site policy"
633
    And I should see "short text2"
634
    And I should not see "full text2"
1441 ariadna 635
    And I set the field "I agree to the This site policy." to "1"
1 efrain 636
    And I press "Next"
637
    And I should not see "I understand and agree"
638
    And I set the following fields to these values:
639
      | Username      | user1                 |
640
      | Password      | user1                 |
1441 ariadna 641
      | Email address | user1@example.com |
642
      | Email (again) | user1@example.com |
1 efrain 643
      | First name    | User1                 |
644
      | Last name     | L1                    |
645
    And I press "Create my new account"
646
    And I should see "Confirm your account"
1441 ariadna 647
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 648
    And I confirm email for "user1"
649
    And I should see "Thanks, User1 L1"
650
    And I should see "Your registration has been confirmed"
651
    And I open my profile in edit mode
652
    And the field "First name" matches value "User1"
653
    And I log out
654
    # Confirm that user can login and browse the site.
655
    And I log in as "user1"
656
    And I follow "Profile" in the user menu
657
    # User can see his own agreements in the profile.
658
    And I follow "Policies and agreements"
659
    And "Accepted" "text" should exist in the "This site policy" "table_row"
660
    And I log out
661
 
662
  Scenario: Accepting policies on sign up, multiple policies with different style of giving ageement.
663
    Given the following config values are set as admin:
664
      | registerauth      | email       |
665
      | passwordpolicy    | 0           |
666
      | sitepolicyhandler | tool_policy |
667
    And the following policies exist:
668
      | name                          | summary                   | content             | agreementstyle  |
669
      | Privacy policy                | We scan your thoughts     | Here goes content.  | 0               |
670
      | Digital maturity declaration  | You declare be old enough | Here goes content.  | 1               |
671
      | Cookies policy                | We eat cookies, srsly     | Here goes content.  | 0               |
672
      | Terms of Service              | We teach, you learn       | Here goes content.  | 1               |
673
    And I am on site homepage
674
    And I follow "Log in"
675
    When I click on "Create new account" "link"
676
    # The first policy with the agreement style "on its own page" must be accepted first.
677
    Then I should see "Digital maturity declaration" in the "region-main" "region"
678
    And I should see "You declare be old enough"
679
    And I should see "Here goes content."
1441 ariadna 680
    And I press "I agree to the Digital maturity declaration."
1 efrain 681
    # The second policy with the agreement style "on its own page" must be accepted now.
682
    And I should see "Terms of Service" in the "region-main" "region"
683
    And I should see "We teach, you learn"
684
    And I should see "Here goes content."
1441 ariadna 685
    And I press "I agree to the Terms of Service."
1 efrain 686
    # Only now we see the remaining consent page policies.
687
    And I should see "Policy 1 out of 2"
688
    And I should see "Privacy policy" in the "region-main" "region"
689
    And I should see "We scan your thoughts"
690
    And I should see "Here goes content."
691
    And I press "Next"
692
    And I should see "Policy 2 out of 2"
693
    And I should see "Cookies policy" in the "region-main" "region"
694
    And I should see "We eat cookies, srsly"
695
    And I should see "Here goes content."
696
    And I press "Next"
1441 ariadna 697
    And I should see "Please agree to the following policies:"
1 efrain 698
    And I should see "Privacy policy"
699
    And I should see "Cookies policy"
700
    And I should not see "Digital maturity declaration" in the "region-main" "region"
701
    And I should not see "Terms of Service" in the "region-main" "region"
702
    And I should not see "Here goes content."
1441 ariadna 703
    And I set the field "I agree to the Privacy policy." to "1"
704
    And I set the field "I agree to the Cookies policy." to "1"
1 efrain 705
    And I press "Next"
706
    And I should see "New account"
707
    And I set the following fields to these values:
708
      | Username      | user1                 |
709
      | Password      | user1                 |
1441 ariadna 710
      | Email address | user1@example.com |
711
      | Email (again) | user1@example.com |
1 efrain 712
      | First name    | User1                 |
713
      | Last name     | L1                    |
714
    And I press "Create my new account"
715
    And I should see "Confirm your account"
1441 ariadna 716
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 717
    And I confirm email for "user1"
718
    And I should see "Thanks, User1 L1"
719
    And I should see "Your registration has been confirmed"
720
    And I open my profile in edit mode
721
    And the field "First name" matches value "User1"
722
    And I log out
723
    # Confirm that user can login and browse the site.
724
    And I log in as "user1"
725
    And I follow "Profile" in the user menu
726
    # User can see his own agreements in the profile.
727
    And I follow "Policies and agreements"
728
    And "Accepted" "text" should exist in the "Privacy policy" "table_row"
729
    And "Accepted" "text" should exist in the "Cookies policy" "table_row"
730
    And "Accepted" "text" should exist in the "Terms of Service" "table_row"
731
    And "Accepted" "text" should exist in the "Digital maturity declaration" "table_row"
732
    And I log out
733
 
734
  Scenario: Accepting policies on login, multiple policies with different style of giving ageement.
735
    Given the following config values are set as admin:
736
      | sitepolicyhandler | tool_policy |
737
    And the following policies exist:
738
      | name                          | summary                   | content             | agreementstyle  |
739
      | Digital maturity declaration  | You declare be old enough | Here goes content.  | 1               |
740
      | Privacy policy                | We scan your thoughts     | Here goes content.  | 0               |
741
      | Terms of Service              | We teach, you learn       | Here goes content.  | 1               |
742
      | Cookies policy                | We eat cookies, srsly     | Here goes content.  | 0               |
743
    And the following "users" exist:
744
      | username | firstname | lastname | email             |
745
      | user1    | User      | One      | user1@example.com |
746
    And I log in as "user1"
747
    # The first policy with the agreement style "on its own page" must be accepted first.
748
    Then I should see "Digital maturity declaration" in the "region-main" "region"
749
    And I should see "You declare be old enough"
750
    And I should see "Here goes content."
1441 ariadna 751
    And I press "I agree to the Digital maturity declaration."
1 efrain 752
    # The second policy with the agreement style "on its own page" must be accepted now.
753
    And I should see "Terms of Service" in the "region-main" "region"
754
    And I should see "We teach, you learn"
755
    And I should see "Here goes content."
756
    # If the user logs out now, only the first policy is accepted and we return to the same page.
757
    And I log out
758
    And I log in as "user1"
759
    And I should see "Terms of Service" in the "region-main" "region"
760
    And I should see "We teach, you learn"
761
    And I should see "Here goes content."
1441 ariadna 762
    And I press "I agree to the Terms of Service."
1 efrain 763
    # Only now we see the remaining consent page policies.
764
    And I should see "Policy 1 out of 2"
765
    And I should see "Privacy policy" in the "region-main" "region"
766
    And I should see "We scan your thoughts"
767
    And I should see "Here goes content."
768
    And I press "Next"
769
    And I should see "Policy 2 out of 2"
770
    And I should see "Cookies policy" in the "region-main" "region"
771
    And I should see "We eat cookies, srsly"
772
    And I should see "Here goes content."
773
    And I press "Next"
1441 ariadna 774
    And I should see "Please agree to the following policies:"
1 efrain 775
    And I should see "Privacy policy"
776
    And I should see "Cookies policy"
777
    And I should not see "Digital maturity declaration" in the "region-main" "region"
778
    And I should not see "Terms of Service" in the "region-main" "region"
779
    And I should not see "Here goes content."
1441 ariadna 780
    And I set the field "I agree to the Privacy policy." to "1"
781
    And I set the field "I agree to the Cookies policy." to "1"
1 efrain 782
    And I press "Next"
783
    And I follow "Profile" in the user menu
784
    # User can see his own agreements in the profile.
785
    And I follow "Policies and agreements"
786
    And "Accepted" "text" should exist in the "Privacy policy" "table_row"
787
    And "Accepted" "text" should exist in the "Cookies policy" "table_row"
788
    And "Accepted" "text" should exist in the "Terms of Service" "table_row"
789
    And "Accepted" "text" should exist in the "Digital maturity declaration" "table_row"
790
    And I log out
791
 
792
  Scenario: Accepting policies on login, all and loggedin policies to be accepted on their own page.
793
    Given the following config values are set as admin:
794
      | sitepolicyhandler | tool_policy |
795
    And the following policies exist:
796
      | name                          | summary                   | content             | agreementstyle  | audience  |
797
      | Privacy policy                | We scan your thoughts     | Here goes content.  | 1               | all       |
798
      | Digital maturity declaration  | You declare be old enough | Here goes content.  | 1               | loggedin  |
799
      | Cookies policy                | We eat cookies, srsly     | Here goes content.  | 1               | guest     |
800
      | Terms of Service              | We teach, you learn       | Here goes content.  | 1               | all       |
801
    And the following "users" exist:
802
      | username | firstname | lastname | email             |
803
      | user1    | User      | One      | user1@example.com |
804
    And I log in as "user1"
805
    # All the policies to be displayed one by one with a button to accept each of them prior seeing the next.
806
    Then I should see "Privacy policy" in the "region-main" "region"
807
    And I should see "We scan your thoughts"
808
    And I should see "Here goes content."
1441 ariadna 809
    And I press "I agree to the Privacy policy."
1 efrain 810
    And I should see "Digital maturity declaration" in the "region-main" "region"
811
    And I should see "You declare be old enough"
812
    And I should see "Here goes content."
1441 ariadna 813
    And I press "I agree to the Digital maturity declaration."
1 efrain 814
    And I should see "Terms of Service" in the "region-main" "region"
815
    And I should see "We teach, you learn"
816
    And I should see "Here goes content."
1441 ariadna 817
    And I press "I agree to the Terms of Service."
1 efrain 818
    And I follow "Profile" in the user menu
819
    And I follow "Policies and agreements"
820
    And "Accepted" "text" should exist in the "Privacy policy" "table_row"
821
    And "Accepted" "text" should exist in the "Terms of Service" "table_row"
822
    And "Accepted" "text" should exist in the "Digital maturity declaration" "table_row"
823
    And "Cookies policy" "table_row" should not exist
824
    And I log out
825
 
826
  Scenario: Accepting policies on sign up, policies to be accepted on their own page.
827
    Given the following config values are set as admin:
828
      | registerauth      | email       |
829
      | passwordpolicy    | 0           |
830
      | sitepolicyhandler | tool_policy |
831
    And the following policies exist:
832
      | name                          | summary                   | content             | agreementstyle  | audience  |
833
      | Privacy policy                | We scan your thoughts     | Here goes content.  | 1               | guest     |
834
      | Digital maturity declaration  | You declare be old enough | Here goes content.  | 1               | all       |
835
      | Cookies policy                | We eat cookies, srsly     | Here goes content.  | 1               | loggedin  |
836
      | Terms of Service              | We teach, you learn       | Here goes content.  | 1               | guest     |
837
    And I am on site homepage
838
    And I follow "Log in"
839
    When I click on "Create new account" "link"
840
    # All the policies to be displayed one by one with a button to accept each of them prior seeing the next.
841
    Then I should see "Digital maturity declaration" in the "region-main" "region"
842
    And I should see "You declare be old enough"
843
    And I should see "Here goes content."
1441 ariadna 844
    And I press "I agree to the Digital maturity declaration."
1 efrain 845
    And I should see "Cookies policy" in the "region-main" "region"
846
    And I should see "We eat cookies, srsly"
1441 ariadna 847
    And I press "I agree to the Cookies policy."
1 efrain 848
    And I should see "New account"
849
    And I set the following fields to these values:
850
      | Username      | user1                 |
851
      | Password      | user1                 |
1441 ariadna 852
      | Email address | user1@example.com |
853
      | Email (again) | user1@example.com |
1 efrain 854
      | First name    | User1                 |
855
      | Last name     | L1                    |
856
    And I press "Create my new account"
857
    And I should see "Confirm your account"
1441 ariadna 858
    And I should see "An email should have been sent to your address at user1@example.com"
1 efrain 859
    And I confirm email for "user1"
860
    And I should see "Thanks, User1 L1"
861
    And I should see "Your registration has been confirmed"
862
    And I open my profile in edit mode
863
    And the field "First name" matches value "User1"
864
    And I log out
865
    # Confirm that user can login and browse the site.
866
    And I log in as "user1"
867
    And I follow "Profile" in the user menu
868
    # User can see his own agreements in the profile.
869
    And I follow "Policies and agreements"
870
    And "Accepted" "text" should exist in the "Digital maturity declaration" "table_row"
871
    And "Accepted" "text" should exist in the "Cookies policy" "table_row"
872
    And "Privacy policy" "table_row" should not exist
873
    And "Terms of Service" "table_row" should not exist
874
    And I log out