From ecc80ef84b8d98096f2fc6f1a016fc8b5c091183 Mon Sep 17 00:00:00 2001 From: Sam Macbeth Date: Tue, 8 Nov 2022 13:55:33 +0100 Subject: [PATCH] Fix borlabs tests. --- rules/autoconsent/borlabs.json | 49 +++++++++++++++++++++++++++------- tests/borlabs.spec.ts | 6 ++--- tests/sourcepoint.spec.ts | 1 + 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/rules/autoconsent/borlabs.json b/rules/autoconsent/borlabs.json index 343a3228..6146918d 100644 --- a/rules/autoconsent/borlabs.json +++ b/rules/autoconsent/borlabs.json @@ -1,12 +1,43 @@ { "name": "borlabs", - "prehideSelectors": ["#BorlabsCookieBox"], - "detectCmp": [{ "exists": "._brlbs-block-content"}], - "detectPopup": [{ "visible": "._brlbs-bar-wrap,._brlbs-box-wrap" }], - "optIn": [{ "click": "a[data-cookie-accept-all]" }], + "detectCmp": [ + { + "exists": "._brlbs-block-content" + } + ], + "detectPopup": [ + { + "visible": "._brlbs-bar-wrap,._brlbs-box-wrap" + } + ], + "optIn": [ + { + "click": "a[data-cookie-accept-all]" + } + ], "optOut": [ - { - "click": "a[data-cookie-refuse]" - } - ] -} + { + "click": "a[data-cookie-individual]" + }, + { + "waitForVisible": ".cookie-preference" + }, + { + "click": "input[data-borlabs-cookie-checkbox]:checked", + "all": true, + "optional": true + }, + { + "click": "#CookiePrefSave" + }, + { + "wait": 500 + } + ], + "prehideSelectors": [ + "#BorlabsCookieBox" + ], + "test": [{ + "eval": "!JSON.parse(decodeURIComponent(document.cookie.split(';').find(c => c.indexOf('borlabs-cookie') !== -1).split('=', 2)[1])).consents.statistics" + }] +} \ No newline at end of file diff --git a/tests/borlabs.spec.ts b/tests/borlabs.spec.ts index 10b257bd..a9fdaf60 100644 --- a/tests/borlabs.spec.ts +++ b/tests/borlabs.spec.ts @@ -1,7 +1,7 @@ import generateCMPTests from "../playwright/runner"; generateCMPTests('borlabs', [ - 'https://reitschuster.de'], { - skipRegions: ["US"] - } + 'https://www.experto.de/', 'https://www.kesselheld.de/'], { + skipRegions: ["US"] +} ); diff --git a/tests/sourcepoint.spec.ts b/tests/sourcepoint.spec.ts index 3e06370b..5723cc78 100644 --- a/tests/sourcepoint.spec.ts +++ b/tests/sourcepoint.spec.ts @@ -10,6 +10,7 @@ generateCMPTests('Sourcepoint-frame', [ "https://www.brianmadden.com/", "https://www.csoonline.com/blogs", "https://www.independent.co.uk/", + "https://reitschuster.de/" ], { skipRegions: ["US", "GB"], });