From ba7067e21bdbafaa697393a1d7a55482ab841f69 Mon Sep 17 00:00:00 2001 From: Maxim Tsoy Date: Mon, 13 May 2024 15:54:46 +0200 Subject: [PATCH] Add support for cookieCuttr CMP --- rules/autoconsent/cookiecuttr.json | 37 ++++++++++++++++++++++++++++++ tests/cookiecuttr.spec.ts | 7 ++++++ 2 files changed, 44 insertions(+) create mode 100644 rules/autoconsent/cookiecuttr.json create mode 100644 tests/cookiecuttr.spec.ts 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/', +]);