diff --git a/rules/autoconsent/affinity-serif-com.json b/rules/autoconsent/affinity-serif-com.json new file mode 100644 index 00000000..d1f80bf3 --- /dev/null +++ b/rules/autoconsent/affinity-serif-com.json @@ -0,0 +1,40 @@ +{ + "name": "affinity.serif.com", + "detectCmp": [ + { + "exists": ".c-cookie-banner" + }, + { + "exists": ".c-cookie-banner button" + } + ], + "detectPopup": [ + { "visible": ".c-cookie-banner" } + ], + "optIn": [ + { "click": "button[data-qa=\"allow-all-cookies\"]" } + ], + "optOut": [ + { + "click": "button[data-qa=\"manage-cookies\"]" + }, + { + "waitFor": ".c-cookie-banner ~ [role=\"dialog\"]" + }, + { + "waitForThenClick": ".c-cookie-banner ~ [role=\"dialog\"] input[type=\"checkbox\"][value=\"true\"]", + "all": true + }, + { + "click": ".c-cookie-banner ~ [role=\"dialog\"] .c-modal__action button" + } + ], + "test": [ + { + "wait": 500 + }, + { + "eval": "document.cookie.includes('serif_manage_cookies_viewed') && !document.cookie.includes('serif_allow_analytics')" + } + ] +} diff --git a/tests/affinity-serif-com.spec.ts b/tests/affinity-serif-com.spec.ts new file mode 100644 index 00000000..e0105d84 --- /dev/null +++ b/tests/affinity-serif-com.spec.ts @@ -0,0 +1,5 @@ +import generateCMPTests from "../playwright/runner"; + +generateCMPTests('affinity.serif.com', [ + 'https://affinity.serif.com/en-us/photo/' +]);