From a80d38a3a46e127ff6bd6cc0e3cf74fee9fa1121 Mon Sep 17 00:00:00 2001 From: Maxim Tsoy Date: Fri, 1 Dec 2023 14:53:56 +0100 Subject: [PATCH] Add a rule for yahoo pop-up --- rules/autoconsent/yahoo.json | 15 +++++++++++++++ tests/yahoo.spec.ts | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 rules/autoconsent/yahoo.json create mode 100644 tests/yahoo.spec.ts diff --git a/rules/autoconsent/yahoo.json b/rules/autoconsent/yahoo.json new file mode 100644 index 00000000..6082adce --- /dev/null +++ b/rules/autoconsent/yahoo.json @@ -0,0 +1,15 @@ +{ + "name": "Yahoo", + "runContext": { + "urlPattern": "^https://consent\\.yahoo\\.com/v2/" + }, + "prehideSelectors": ["#reject-all"], + "detectCmp": [{ "exists": "#consent-page" }], + "detectPopup": [{ "visible": "#consent-page" }], + "optIn": [ + { "waitForThenClick": "#consent-page button[value=agree]" } + ], + "optOut": [ + { "waitForThenClick": "#consent-page button[value=reject]" } + ] +} \ No newline at end of file diff --git a/tests/yahoo.spec.ts b/tests/yahoo.spec.ts new file mode 100644 index 00000000..365323f5 --- /dev/null +++ b/tests/yahoo.spec.ts @@ -0,0 +1,7 @@ +import generateCMPTests from "../playwright/runner"; + +generateCMPTests('Yahoo', [ + 'https://www.yahoo.com/' +], { + skipRegions: ['US'] +});