Skip to content

Commit

Permalink
add batch of rules and tests for banners reported by users (#181)
Browse files Browse the repository at this point in the history
* add justwatch-com rules and test

* add 1password-com rules and test

* add agolde-com rules and test

* add altium-com rules and test

* add aquasana-com rules and test

* add athlinks-com rules and test

* add burpee-com rules and test

* add crossfit-com rules and test

* add flex-orange-pl rules and test

* itopvpn-com rules and test

* add macpaw-com rules and test

* add nrk-no rules and test

* add pinetools-com rules and test

* add similarweb-com rules and test

* add takealot-com rules and test

* add trader-joes-com rules and test

* add urbanarmorgear-com rules and test

* add tidbits-com automattic cmp site rules and test

* add cmp automattic rules and test

* add woo-commerce-com rules and test

* add xhamster-eu rules and test

* add tumblr-com rules and test

* fix complianz-optin rules and test

* add urlPattern to athlinks-com rule

* make automattic cmp and popUp more specific

* simplify optOut for complianz-optin

* change justwatch notice banner to optOut banner

* Remove orange.pl rule

---------

Co-authored-by: euw-arasolofotsara1 <[email protected]>
Co-authored-by: Sam Macbeth <[email protected]>
  • Loading branch information
3 people authored Jun 20, 2023
1 parent d5b9b97 commit afbf00e
Show file tree
Hide file tree
Showing 45 changed files with 381 additions and 6 deletions.
11 changes: 11 additions & 0 deletions rules/autoconsent/1password-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "1password-com",
"cosmetic": true,
"prehideSelectors": ["footer #footer-root [aria-label=\"Cookie Consent\"]"],
"detectCmp": [{ "exists": "footer #footer-root [aria-label=\"Cookie Consent\"]" }],
"detectPopup": [{ "visible": "footer #footer-root [aria-label=\"Cookie Consent\"]" }],
"optIn":
[{"click": "footer #footer-root [aria-label=\"Cookie Consent\"] button" }],
"optOut": [{ "hide": ["footer #footer-root [aria-label=\"Cookie Consent\"]"] }]
}

13 changes: 13 additions & 0 deletions rules/autoconsent/agolde-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "agolde.com",
"cosmetic": true,
"prehideSelectors": ["#modal-1 div[data-micromodal-close]"],
"detectCmp": [{ "exists": "#modal-1 div[aria-labelledby=modal-1-title]" }],
"detectPopup": [{ "exists": "#modal-1 div[data-micromodal-close]" }],
"optIn": [
{ "click": "button[aria-label=\"Close modal\"]" }
],
"optOut": [
{ "hide": ["#modal-1 div[data-micromodal-close]"] }
]
}
9 changes: 9 additions & 0 deletions rules/autoconsent/altium-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "altium.com",
"cosmetic": true,
"prehideSelectors": [".altium-privacy-bar"],
"detectCmp": [{ "exists": ".altium-privacy-bar" }],
"detectPopup": [{ "exists": ".altium-privacy-bar" }],
"optIn": [{ "click": "a.altium-privacy-bar__btn" }],
"optOut": [{ "hide": [".altium-privacy-bar"] }]
}
9 changes: 9 additions & 0 deletions rules/autoconsent/aquasana-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "aquasana.com",
"cosmetic": true,
"prehideSelectors": ["#consent-tracking"],
"detectCmp": [{ "exists": "#consent-tracking" }],
"detectPopup": [{ "exists": "#consent-tracking" }],
"optIn": [{ "click": "#accept_consent" }],
"optOut": [{ "hide": ["#consent-tracking"] }]
}
12 changes: 12 additions & 0 deletions rules/autoconsent/athlinks-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "athlinks-com",
"runContext": {
"urlPattern": "^https://(www\\.)?athlinks\\.com/"
},
"cosmetic": true,
"prehideSelectors": ["#footer-container ~ div"],
"detectCmp": [{ "exists": "#footer-container ~ div" }],
"detectPopup": [{ "visible": "#footer-container > div" }],
"optIn": [{"click": "#footer-container ~ div button" }],
"optOut": [{ "hide": ["#footer-container ~ div"] }]
}
19 changes: 19 additions & 0 deletions rules/autoconsent/automattic-cmp-optout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "automattic-cmp-optout",
"prehideSelectors": ["form[class*=\"cookie-banner\"][method=\"post\"]"],
"detectCmp": [{ "exists": "form[class*=\"cookie-banner\"][method=\"post\"]" }],
"detectPopup": [{ "visible": "form[class*=\"cookie-banner\"][method=\"post\"]" }],
"optIn": [{ "click": "a[class*=\"accept-all-button\"]" }],
"optOut": [
{
"click": "form[class*=\"cookie-banner\"] div[class*=\"simple-options\"] a[class*=\"customize-button\"]"
},
{
"waitForThenClick": "input[type=checkbox][checked]:not([disabled])",
"all":true
},
{
"click": "a[class*=\"accept-selection-button\"]"
}
]
}
13 changes: 13 additions & 0 deletions rules/autoconsent/burpee-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "burpee.com",
"cosmetic": true,
"prehideSelectors": ["#notice-cookie-block"],
"detectCmp": [{ "exists": "#notice-cookie-block" }],
"detectPopup": [{ "exists": "#html-body #notice-cookie-block" }],
"optIn": [
{ "click": "#btn-cookie-allow" }
],
"optOut": [
{ "hide": ["#html-body #notice-cookie-block"] }
]
}
4 changes: 2 additions & 2 deletions rules/autoconsent/complianz-optin.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"optOut": [
{ "click": ".cc-settings" },
{ "waitForVisible": "[aria-label=\"cookies preferences popup\"]" },
{ "click": "[aria-label=\"cookies preferences popup\"] input[type=checkbox]:not([disabled])", "all": true },
{ "click": "[aria-label=\"cookies preferences popup\"] [aria-label=\"Accept Selected\"]" }
{ "click": "[aria-label=\"cookies preferences popup\"] input[type=checkbox]:not([disabled]):checked", "all": true, "optional": true },
{ "click": "[aria-label=\"cookies preferences popup\"] [aria-label=\"Accept Selected\"], [aria-label=\"cookies preferences popup\"] [aria-label=\"Save my choice\"], .cc-btn-accept-selected, .cc-deny", "optional": true }
],
"test": [
{ "eval": "!!document.cookie.match(/cookieconsent_preferences_disabled=[^;]+/)" }
Expand Down
10 changes: 10 additions & 0 deletions rules/autoconsent/crossfit-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "crossfit-com",
"cosmetic": true,
"prehideSelectors": ["body #modal > div > div[class^=\"_wrapper_\"]"],
"detectCmp": [{ "exists": "body #modal > div > div[class^=\"_wrapper_\"]" }],
"detectPopup": [{ "visible": "body #modal > div > div[class^=\"_wrapper_\"]" }],
"optIn": [{"click": "button[aria-label=\"accept cookie policy\"]" }],
"optOut": [{ "hide": ["body #modal > div > div[class^=\"_wrapper_\"]"] }]
}

13 changes: 13 additions & 0 deletions rules/autoconsent/itopvpn-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "itopvpn.com",
"cosmetic": true,
"prehideSelectors": [".pop-cookie"],
"detectCmp": [{ "exists": ".pop-cookie" }],
"detectPopup": [{ "exists": ".pop-cookie" }],
"optIn": [
{ "click": "#_pcookie" }
],
"optOut": [
{ "hide": [".pop-cookie"] }
]
}
15 changes: 15 additions & 0 deletions rules/autoconsent/justwatch-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "justwatch.com",
"prehideSelectors": [".consent-banner"],
"detectCmp": [{ "exists": ".consent-banner" }],
"detectPopup": [{ "exists": ".consent-banner" }],
"optIn": [{ "click": ".consent-banner__actions button.basic-button.primary" }],
"optOut": [
{ "click": ".consent-banner__actions button.basic-button.secondary" },
{ "waitForThenClick": ".consent-modal__footer button.basic-button.secondary" },
{ "waitForThenClick": ".consent-modal ion-content > div > a:nth-child(9)" },
{ "click": "label.consent-switch input[type=checkbox]:checked", "all": true, "optional": true },
{ "waitForVisible": ".consent-modal__footer button.basic-button.primary" },
{ "click": ".consent-modal__footer button.basic-button.primary"}
]
}
13 changes: 13 additions & 0 deletions rules/autoconsent/macpaw-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "macpaw.com",
"cosmetic": true,
"prehideSelectors": ["div[data-banner=\"cookies\"]"],
"detectCmp": [{ "exists": "div[data-banner=\"cookies\"]" }],
"detectPopup": [{ "exists": "div[data-banner=\"cookies\"]" }],
"optIn": [
{ "click": "button[data-banner-close=\"cookies\"]" }
],
"optOut": [
{ "hide": ["div[data-banner=\"cookies\"]"] }
]
}
9 changes: 9 additions & 0 deletions rules/autoconsent/nrk-no.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "nrk.no",
"cosmetic": true,
"prehideSelectors": [".nrk-masthead__info-banner--cookie"],
"detectCmp": [{ "exists": ".nrk-masthead__info-banner--cookie" }],
"detectPopup": [{ "exists": ".nrk-masthead__info-banner--cookie" }],
"optIn": [{ "click": "div.nrk-masthead__info-banner--cookie button > span:has(+ svg.nrk-close)" }],
"optOut": [{ "hide": [".nrk-masthead__info-banner--cookie"] }]
}
13 changes: 13 additions & 0 deletions rules/autoconsent/pinetools-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "pinetools.com",
"cosmetic": true,
"prehideSelectors": ["#aviso_cookies"],
"detectCmp": [{ "exists": "#aviso_cookies" }],
"detectPopup": [{ "exists": ".lang_en #aviso_cookies" }],
"optIn": [
{ "click": "#aviso_cookies .a_boton_cerrar" }
],
"optOut": [
{ "hide": ["#aviso_cookies"] }
]
}
13 changes: 13 additions & 0 deletions rules/autoconsent/similarweb-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "similarweb.com",
"cosmetic": true,
"prehideSelectors": [".app-cookies-notification"],
"detectCmp": [{ "exists": ".app-cookies-notification" }],
"detectPopup": [{ "exists": ".app-layout .app-cookies-notification" }],
"optIn": [
{ "click": "button.app-cookies-notification__dismiss" }
],
"optOut": [
{ "hide": [".app-layout .app-cookies-notification"] }
]
}
13 changes: 13 additions & 0 deletions rules/autoconsent/takealot-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "takealot.com",
"cosmetic": true,
"prehideSelectors": ["div[class^=\"cookies-banner-module_cookie-banner_\"]"],
"detectCmp": [{ "exists": "div[class^=\"cookies-banner-module_cookie-banner_\"]" }],
"detectPopup": [{ "exists": "div[class^=\"cookies-banner-module_cookie-banner_\"]" }],
"optIn": [
{ "click": "button[class*=\"cookies-banner-module_dismiss-button_\"]" }
],
"optOut": [
{ "hide": ["div[class^=\"cookies-banner-module_cookie-banner_\"]"] }
]
}
9 changes: 9 additions & 0 deletions rules/autoconsent/tidbits-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "tidbits-com",
"cosmetic": true,
"prehideSelectors": ["#eu_cookie_law_widget-2"],
"detectCmp": [{ "exists": "#eu_cookie_law_widget-2" }],
"detectPopup": [{ "visible": "#eu_cookie_law_widget-2" }],
"optIn": [{ "click": "#eu-cookie-law form > input.accept" }],
"optOut": [{ "hide": ["#eu_cookie_law_widget-2"] }]
}
9 changes: 9 additions & 0 deletions rules/autoconsent/trader-joes-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "trader-joes-com",
"cosmetic": true,
"prehideSelectors": ["div.aem-page > div[class^=\"CookiesAlert_cookiesAlert__\"]"],
"detectCmp": [{ "exists": "div.aem-page > div[class^=\"CookiesAlert_cookiesAlert__\"]" }],
"detectPopup": [{ "visible": "div.aem-page > div[class^=\"CookiesAlert_cookiesAlert__\"]" }],
"optIn": [{"click": "div[class^=\"CookiesAlert_cookiesAlert__container__\"] button" }],
"optOut": [{ "hide": ["div.aem-page > div[class^=\"CookiesAlert_cookiesAlert__\"]"] }]
}
10 changes: 10 additions & 0 deletions rules/autoconsent/tumblr-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "tumblr-com",
"cosmetic": true,
"prehideSelectors": ["#cmp-app-container"],
"detectCmp": [{ "exists": "#cmp-app-container" }],
"detectPopup": [{ "visible": "#cmp-app-container" }],
"optIn":
[{"click": "#tumblr #cmp-app-container div.components-modal__frame > iframe > html body > div > div > div.cmp__dialog-footer > div > button.components-button.white-space-normal.is-primary" }],
"optOut": [{ "hide": ["#cmp-app-container"] }]
}
9 changes: 9 additions & 0 deletions rules/autoconsent/urbanarmorgear-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "urbanarmorgear-com",
"cosmetic": true,
"prehideSelectors": ["div[class^=\"Layout__CookieBannerContainer-\"]"],
"detectCmp": [{ "exists": "div[class^=\"Layout__CookieBannerContainer-\"]" }],
"detectPopup": [{ "visible": "div[class^=\"Layout__CookieBannerContainer-\"]" }],
"optIn": [{"click": "button[class^=\"CookieBanner__AcceptButton\"]" }],
"optOut": [{ "hide": ["div[class^=\"Layout__CookieBannerContainer-\"]"] }]
}
20 changes: 20 additions & 0 deletions rules/autoconsent/woo-commerce-com.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "woo-commerce-com",
"prehideSelectors": [".wccom-comp-privacy-banner .wccom-privacy-banner"],
"detectCmp": [{ "exists": ".wccom-comp-privacy-banner .wccom-privacy-banner" }],
"detectPopup": [{ "exists": ".wccom-comp-privacy-banner .wccom-privacy-banner" }],
"optIn": [{ "click": ".wccom-privacy-banner__content-buttons button.is-primary" }],
"optOut":[
{
"click": ".wccom-privacy-banner__content-buttons button.is-secondary"
},
{
"waitForThenClick": "input[type=checkbox][checked]:not([disabled])",
"all":true
},
{
"click": "div.wccom-modal__footer > button"
}
]
}

15 changes: 15 additions & 0 deletions rules/autoconsent/xhamster-eu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "xhamster-eu",
"prehideSelectors": [".cookies-modal"],
"detectCmp": [{ "exists": ".cookies-modal" }],
"detectPopup": [{ "exists": ".cookies-modal" }],
"optIn": [
{ "click": "button.cmd-button-accept-all" }
],
"optOut": [
{
"click": "button.cmd-button-reject-all"
}
]
}

5 changes: 5 additions & 0 deletions tests/1password-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('1password-com', [
'https://1password.com/product/mac/'
], {});
5 changes: 5 additions & 0 deletions tests/agolde-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('agolde.com', [
'https://agolde.com/',
], {});
5 changes: 5 additions & 0 deletions tests/altium-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('altium.com', [
'https://www.altium.com/',
], {});
5 changes: 5 additions & 0 deletions tests/aquasana-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('aquasana.com', [
'https://www.aquasana.com/',
], {});
5 changes: 5 additions & 0 deletions tests/athlinks-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('athlinks-com', [
'https://www.athlinks.com/'
], {});
9 changes: 9 additions & 0 deletions tests/automattic-cmp-optout.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('automattic-cmp-optout', [
'https://automattic.com/',
'https://pocketcasts.com/',
'https://en.gravatar.com/',
'https://akismet.com/',
'https://wordpress.com/'
], {});
5 changes: 5 additions & 0 deletions tests/burpee-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('burpee.com', [
'https://www.burpee.com/'
], {});
8 changes: 4 additions & 4 deletions tests/complianz-optin.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import generateCMPTests from "../playwright/runner";

// generateCMPTests('Complianz optin', [
// 'https://stetson.com/',
// ], {
// });
generateCMPTests('Complianz optin', [
//'https://stetson.com/',
'https://marahoffman.com/'
], {});
5 changes: 5 additions & 0 deletions tests/crossfit-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('crossfit-com', [
'https://www.crossfit.com/'
], {});
5 changes: 5 additions & 0 deletions tests/flex-orange-pl.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('flex-orange-pl', [
'https://flex.orange.pl/'
], {});
5 changes: 5 additions & 0 deletions tests/itopvpn-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('itopvpn.com', [
'https://www.itopvpn.com/',
], {});
5 changes: 5 additions & 0 deletions tests/justwatch-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('justwatch.com', [
'https://www.justwatch.com/',
], {});
5 changes: 5 additions & 0 deletions tests/macpaw-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('macpaw.com', [
'https://macpaw.com/',
], {});
5 changes: 5 additions & 0 deletions tests/nrk-no.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('nrk.no', [
'https://www.nrk.no/',
], {});
5 changes: 5 additions & 0 deletions tests/pinetools-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('pinetools.com', [
'https://pinetools.com/',
], {});
5 changes: 5 additions & 0 deletions tests/similarweb-com.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import generateCMPTests from "../playwright/runner";

generateCMPTests('similarweb.com', [
'https://www.similarweb.com/',
], {});
Loading

0 comments on commit afbf00e

Please sign in to comment.