diff --git a/rules/autoconsent/cookiecuttr.json b/rules/autoconsent/cookiecuttr.json new file mode 100644 index 00000000..6e7787ec --- /dev/null +++ b/rules/autoconsent/cookiecuttr.json @@ -0,0 +1,37 @@ +{ + "name": "cookiecuttr", + "vendorUrl": "https://github.com/cdwharton/cookieCuttr", + "cosmetic": false, + "runContext": { + "main": true, + "frame": false, + "urlPattern": "" + }, + "prehideSelectors": [".cc-cookies"], + "detectCmp": [ + { + "exists": ".cc-cookies .cc-cookie-accept" + } + ], + "detectPopup": [ + { + "visible": ".cc-cookies .cc-cookie-accept" + } + ], + "optIn": [ + { + "waitForThenClick": ".cc-cookies .cc-cookie-accept" + } + ], + "optOut": [ + { + "if": { "exists": ".cc-cookies .cc-cookie-decline" }, + "then": [{ + "click": ".cc-cookies .cc-cookie-decline" + }], + "else": [{ + "hide": ".cc-cookies" + }] + } + ] +} \ No newline at end of file diff --git a/tests/cookiecuttr.spec.ts b/tests/cookiecuttr.spec.ts new file mode 100644 index 00000000..a963d1d2 --- /dev/null +++ b/tests/cookiecuttr.spec.ts @@ -0,0 +1,7 @@ +import generateCMPTests from "../playwright/runner"; + +generateCMPTests('cookiecuttr', [ + 'https://www.esa.int/', + 'https://hartgeld.com/', + 'https://ocr.org.uk/', +]);