@@ -8,10 +8,12 @@ Feature: CivicTheme Alert content type render
88 | 999992 | [TEST ] Test alert title all pages | 1 | error | | [TEST ] Test alert body all pages | [relative :-1 day #Y -m -d \TH :i :s ] | [relative :+10 days #Y -m -d \TH :i :s ] |
99 | 999993 | [TEST ] Test dismissing alert title all pages | 1 | error | | [TEST ] Test dismissing alert body all pages | [relative :-1 day #Y -m -d \TH :i :s ] | [relative :+10 days #Y -m -d \TH :i :s ] |
1010 | 999994 | [TEST ] Test alert title all pages future | 1 | error | | [TEST ] Test alert body all pages future | [relative :+2 days #Y -m -d \TH :i :s ] | [relative :+10 days #Y -m -d \TH :i :s ] |
11+ | 999995 | [TEST ] Test alert title visibility | 1 | error | | [TEST ] Test alert body visibility | [relative :-1 day #Y -m -d \TH :i :s ] | [relative :+10 days #Y -m -d \TH :i :s ] |
1112
1213 Given civictheme_page content:
13- | title | status |
14- | [TEST ] Test alerts on pages | 1 |
14+ | title | status |
15+ | [TEST ] Test alerts on pages | 1 |
16+ | [TEST ] Test alert visibility | 1 |
1517
1618 @api @javascript
1719 Scenario : Alerts can be viewed on homepage
@@ -118,3 +120,60 @@ Feature: CivicTheme Alert content type render
118120 And I wait for AJAX to finish
119121 Then I should see the text "[TEST] Test alert body all pages"
120122 And I should not see the text "[TEST] Test alert body all pages future"
123+
124+ @api @javascript
125+ Scenario : Alerts visibility
126+ Given I am logged in as a user with the "Site Administrator" role
127+ When I edit civictheme_alert "[TEST] Test alert title visibility"
128+ And I fill in "Page visibility" with:
129+ """
130+ /test-alert/*
131+ /test-alert-page
132+ /test-random-alert-page
133+ """
134+ And I press "Save"
135+ When I edit civictheme_page "[TEST] Test alert visibility"
136+ And I uncheck the box "Generate automatic URL alias"
137+ Then I fill in the following:
138+ | edit -path -0 -alias | /test -alert /test -1 |
139+ And I press "Save"
140+ When I visit "/test-alert/test-1"
141+ And wait 5 second
142+ And I wait for AJAX to finish
143+ Then I should see the text "[TEST] Test alert body visibility"
144+ When I edit civictheme_page "[TEST] Test alert visibility"
145+ And I uncheck the box "Generate automatic URL alias"
146+ Then I fill in the following:
147+ | edit -path -0 -alias | /test -alert /test -2 |
148+ And I press "Save"
149+ When I visit "/test-alert/test-2"
150+ And wait 5 second
151+ And I wait for AJAX to finish
152+ Then I should see the text "[TEST] Test alert body visibility"
153+ When I edit civictheme_page "[TEST] Test alert visibility"
154+ And I uncheck the box "Generate automatic URL alias"
155+ Then I fill in the following:
156+ | edit -path -0 -alias | /test -alert -page |
157+ And I press "Save"
158+ When I visit "/test-alert-page"
159+ And wait 5 second
160+ And I wait for AJAX to finish
161+ Then I should see the text "[TEST] Test alert body visibility"
162+ When I edit civictheme_page "[TEST] Test alert visibility"
163+ And I uncheck the box "Generate automatic URL alias"
164+ Then I fill in the following:
165+ | edit -path -0 -alias | /test -alerts |
166+ And I press "Save"
167+ When I visit "/test-alerts"
168+ And wait 5 second
169+ And I wait for AJAX to finish
170+ Then I should not see the text "[TEST] Test alert body visibility"
171+ When I edit civictheme_page "[TEST] Test alert visibility"
172+ And I uncheck the box "Generate automatic URL alias"
173+ Then I fill in the following:
174+ | edit -path -0 -alias | /test -random -alert -page |
175+ And I press "Save"
176+ When I visit "/test-random-alert-page"
177+ And wait 5 second
178+ And I wait for AJAX to finish
179+ Then I should see the text "[TEST] Test alert body visibility"
0 commit comments