-
Notifications
You must be signed in to change notification settings - Fork 168
/
inform-block.feature
96 lines (82 loc) · 4.6 KB
/
inform-block.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@api @gdpr @inform-block @DS-5586 @stability @stability-4
Feature: Inform about personal data collection
Benefit: So I can make an informed decision.
Role: As a LU
Goal/desire: I want to understand what data the site collects about me
Scenario: Successfully inform user about data collection.
Given users:
| name | mail | status | roles |
| behatadministrator | behatadministrator@example.com | 1 | administrator |
| behatuser | behatuser@example.com | 1 | |
Given I enable the module "social_gdpr"
Given I am logged in as "behatadministrator"
When I am on "admin/config/people/data-policy/settings"
And I uncheck the box "Enforce consent"
Then I press "Save configuration"
When I am on "admin/structure/block"
And I click "Place block"
And I wait for AJAX to finish
And I click the xth "4" element with the css ".block-add-table a"
And I wait for AJAX to finish
And I should see "Data Policy Inform" in the ".form-item-settings-admin-label" element
# Press "Save block" button
Then I select "Complementary top" from "Region"
And I click the xth "0" element with the css ".ui-button.form-submit"
When I am on "admin/config/system/inform-consent"
And I click "Add page"
Then I should be on "admin/config/system/inform-consent/add"
And I should see checked the box "Enable on this page"
And I should see "Title" in the ".form-item-label.form-type-textfield label.form-required" element
And I should see "Page" in the ".form-item-page.form-type-textfield label.form-required" element
And I should see "Summary" in the ".form-item-summary-value.form-type-textarea label.form-required" element
And I should see "Description" in the ".form-item-body-value.form-type-textarea label:not(.form-required)" element
When I fill in "Title" with "Inform block title for sign up page"
And I fill in "Page" with "/user/register"
And I fill in the "Summary" WYSIWYG editor with "Inform block summary for sign up page"
And I fill in the "Description" WYSIWYG editor with "Inform block description for sign up page"
And I press "Save"
Then I should be on "admin/config/system/inform-consent/add"
And I should see "Machine-readable name" in the ".form-item-id.form-type-machine-name label.form-required" element
When I fill in "Machine-readable name" with "sign_up"
And I press "Save"
Then I should be on "admin/config/system/inform-consent"
And I should see the text "Saved the Inform block title for sign up page Example."
And I should see the text "Inform block title for sign up page"
And I should see the text "/user/register"
And I should see the text "Yes"
When I logout
And I click "Sign up"
Then I should see the heading "Inform block title for sign up page" in the "Sidebar second" region
And I should see the text "Inform block summary for sign up page"
And I should see the link "Read more"
When I click "Read more"
And I wait for AJAX to finish
Then I should see "Inform block title for sign up page" in the ".ui-dialog-title" element
And I should see "Inform block description for sign up page" in the ".ui-dialog-content p" element
When I am logged in as "behatadministrator"
And I am on "admin/config/system/inform-consent/add"
And I fill in "Title" with "Inform block title for user edit page"
And I fill in "Page" with "/user/*/edit"
And I fill in the "Summary" WYSIWYG editor with "Inform block summary for user edit page"
And I press "Save"
And I fill in "Machine-readable name" with "user_edit"
And I press "Save"
When I am logged in as "behatuser"
And I click "Profile of behatuser"
And I click "Settings"
Then I should see the heading "Inform block title for user edit page" in the "Sidebar second" region
And I should see the text "Inform block summary for user edit page"
And I should not see the link "Read more"
When I am logged in as "behatadministrator"
And I am on "admin/config/system/inform-consent/user_edit"
And I uncheck the box "Enable on this page"
And I press "Save"
And I am logged in as "behatuser"
And I click "Profile of behatuser"
And I click "Settings"
Then I should not see the text "Inform block title for user edit page"
And I should not see the text "Inform block summary for user edit page"
When I am logged in as "behatadministrator"
And I am on "admin/config/people/data-policy/settings"
And I check the box "Enforce consent"
Then I press "Save configuration"