Skip to content

Commit

Permalink
Improve Civic rule (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov authored Nov 22, 2024
1 parent 98efc82 commit 7e9cfbe
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
28 changes: 23 additions & 5 deletions rules/autoconsent/civic-cookie-control.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
{
"vendorUrl": "https://www.civicuk.com/cookie-control/",
"name": "civic-cookie-control",
"prehideSelectors": ["#ccc-module,#ccc-overlay"],
"detectCmp": [{ "exists": "#ccc-module" }],
"detectPopup": [{ "visible": "#ccc" }, { "visible": "#ccc-module" }],
"optOut": [{ "click": "#ccc-reject-settings" }],
"optIn": [{ "click": "#ccc-recommended-settings" }]
"prehideSelectors": ["#ccc-module,#ccc-overlay,#ccc"],
"detectCmp": [{ "exists": "#ccc-module,#ccc-notify" }],
"detectPopup": [{ "visible": "#ccc" }, { "visible": "#ccc-module,#ccc-notify" }],
"optOut": [
{
"if": { "exists": "#ccc-notify" },
"then": [
{
"waitForThenClick": [
"#ccc #ccc-notify .ccc-notify-buttons",
"xpath///button[contains(., 'Settings') or contains(., 'Cookie Preferences')]"
]
},
{ "waitForVisible": "#ccc-module" }
]
},
{
"if": { "exists": "#ccc-reject-settings" },
"then": [{ "waitForThenClick": "#ccc-reject-settings" }],
"else": [{ "waitForThenClick": "#ccc-dismiss-button" }]
}
],
"optIn": [{ "waitForThenClick": "#ccc-recommended-settings,#ccc-notify-accept" }]
}
2 changes: 1 addition & 1 deletion tests/civic-cookie-control.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import generateCMPTests from '../playwright/runner';

generateCMPTests('civic-cookie-control', ['https://www.birmingham.gov.uk/', 'https://planning.org.uk/'], {
generateCMPTests('civic-cookie-control', ['https://www.birmingham.gov.uk/', 'https://planning.org.uk/', 'https://www.jessops.com/'], {
skipRegions: ['US', 'DE'],
});

0 comments on commit 7e9cfbe

Please sign in to comment.