diff --git a/lib/cmps/base.ts b/lib/cmps/base.ts index cae5a32c..d2efc0ed 100644 --- a/lib/cmps/base.ts +++ b/lib/cmps/base.ts @@ -115,6 +115,11 @@ async function evaluateRuleStep(rule: AutoConsentRuleStep) { results.push(hide(rule.hide, rule.method)); } + if (results.length === 0) { + enableLogs && console.warn('Unrecognized rule', rule); + return false; + } + // boolean and of results const all = await Promise.all(results); return all.reduce((a, b) => a && b, true); diff --git a/lib/cmps/onetrust.ts b/lib/cmps/onetrust.ts index 08e3f7a3..732bb138 100644 --- a/lib/cmps/onetrust.ts +++ b/lib/cmps/onetrust.ts @@ -50,7 +50,7 @@ export default class Onetrust extends AutoConsentCMPBase { } async optIn() { - return click("onetrust-accept-btn-handler,js-accept-cookies"); + return click("#onetrust-accept-btn-handler,.js-accept-cookies"); } async test() { diff --git a/lib/cmps/sourcepoint-frame.ts b/lib/cmps/sourcepoint-frame.ts index 8fe3cff2..b2657441 100644 --- a/lib/cmps/sourcepoint-frame.ts +++ b/lib/cmps/sourcepoint-frame.ts @@ -40,6 +40,7 @@ export default class SourcePoint extends AutoConsentCMPBase { } async optIn() { + await waitForElement(".sp_choice_type_11,.sp_choice_type_ACCEPT_ALL", 2000); if (click(".sp_choice_type_11")) { return true; } @@ -56,10 +57,13 @@ export default class SourcePoint extends AutoConsentCMPBase { async optOut() { if (!this.isManagerOpen()) { + const actionable = await waitForElement('button.sp_choice_type_12,button.sp_choice_type_13'); + if (!actionable) { + return false; + } if (!elementExists("button.sp_choice_type_12")) { // do not sell button - click("button.sp_choice_type_13"); - return true; + return click("button.sp_choice_type_13"); } click("button.sp_choice_type_12"); @@ -82,10 +86,9 @@ export default class SourcePoint extends AutoConsentCMPBase { ]); if (path === 0) { await wait(1000); - click(rejectSelector1); - return true; + return click(rejectSelector1); } else if (path === 1) { - click(rejectSelector2); + return click(rejectSelector2); } else if (path === 2) { // TODO: check if this is still working await waitForElement('.pm-features', 10000); @@ -96,7 +99,6 @@ export default class SourcePoint extends AutoConsentCMPBase { } catch (e) { enableLogs && console.warn(e); } - click('.sp_choice_type_SAVE_AND_EXIT'); - return true; + return click('.sp_choice_type_SAVE_AND_EXIT'); } } diff --git a/lib/cmps/trustarc-top.ts b/lib/cmps/trustarc-top.ts index 4debf227..2aa4a84c 100644 --- a/lib/cmps/trustarc-top.ts +++ b/lib/cmps/trustarc-top.ts @@ -22,10 +22,12 @@ export default class TrustArcTop extends AutoConsentCMPBase { } _shortcutButton: HTMLElement; + _optInDone: boolean; constructor() { super("TrustArc-top"); this._shortcutButton = null; // indicates if the "reject all" button is detected + this._optInDone = false; } get hasSelfTest(): boolean { @@ -33,6 +35,9 @@ export default class TrustArcTop extends AutoConsentCMPBase { } get isIntermediate(): boolean { + if (this._optInDone) { + return false; + } return !this._shortcutButton; } @@ -76,6 +81,7 @@ export default class TrustArcTop extends AutoConsentCMPBase { } async optIn() { + this._optInDone = true; // just a hack to force autoconsentDone return click(shortcutOptIn); } diff --git a/lib/web.ts b/lib/web.ts index 04e2cdfe..8e805297 100644 --- a/lib/web.ts +++ b/lib/web.ts @@ -24,6 +24,9 @@ export default class AutoConsent { if (config) { this.initialize(config, declarativeRules); } else { + if (declarativeRules) { + this.parseRules(declarativeRules); + } const initMsg: InitMessage = { type: "init", url: window.location.href, @@ -39,7 +42,9 @@ export default class AutoConsent { return; } - this.parseRules(declarativeRules); + if (declarativeRules) { + this.parseRules(declarativeRules); + } if (config.disabledCmps?.length > 0) { this.disableCMPs(config.disabledCmps); } @@ -241,7 +246,7 @@ export default class AutoConsent { type: 'optInResult', cmp: this.foundCmp ? this.foundCmp.name : 'none', result: optInResult, - scheduleSelfTest: this.foundCmp && this.foundCmp.hasSelfTest, + scheduleSelfTest: false, // self-tests are only for opt-out at the moment url: location.href, }); diff --git a/playwright/content.ts b/playwright/content.ts index 61c73984..386aec88 100644 --- a/playwright/content.ts +++ b/playwright/content.ts @@ -11,13 +11,7 @@ declare global { } if (!window.autoconsentReceiveMessage) { - const consent = new AutoConsent(window.autoconsentSendMessage, { - enabled: true, - autoAction: 'optOut', - disabledCmps: [], - enablePrehide: true, - detectRetries: 20, - }, rules); + const consent = new AutoConsent(window.autoconsentSendMessage, null, rules); window.autoconsentReceiveMessage = (message: BackgroundMessage) => { return Promise.resolve(consent.receiveMessageCallback(message)); diff --git a/playwright/runner.ts b/playwright/runner.ts index 755ba4d4..8ef58db5 100644 --- a/playwright/runner.ts +++ b/playwright/runner.ts @@ -4,17 +4,20 @@ import { test, expect, Page, Frame } from "@playwright/test"; import { waitFor } from "../lib/utils"; import { ContentScriptMessage } from "../lib/messages"; import { enableLogs } from "../lib/config"; +import { AutoAction } from "../lib/types"; const testRegion = (process.env.REGION || "NA").trim(); type TestOptions = { testOptOut: boolean; testSelfTest: boolean; + testOptIn: boolean; skipRegions?: string[]; onlyRegions?: string[]; }; const defaultOptions: TestOptions = { testOptOut: true, + testOptIn: true, testSelfTest: true, skipRegions: [], onlyRegions: [], @@ -37,85 +40,113 @@ export async function injectContentScript(page: Page | Frame) { export function generateTest( url: string, expectedCmp: string, - options: TestOptions = { testOptOut: true, testSelfTest: true } + options: TestOptions = defaultOptions ) { - test(`${url.split("://")[1]} .${testRegion}`, async ({ page }) => { - if (options.onlyRegions && options.onlyRegions.length > 0 && !options.onlyRegions.includes(testRegion)) { - test.skip(); - } - if (options.skipRegions && options.skipRegions.includes(testRegion)) { - test.skip(); - } - enableLogs && page.on('console', async msg => { - console.log(` page log:`, msg.text()); - }); - await page.exposeBinding("autoconsentSendMessage", messageCallback); - await page.goto(url, { waitUntil: "commit" }); - - // set up a messaging function - const received: ContentScriptMessage[] = []; - - function isMessageReceived(msg: Partial, partial = true) { - return received.some((m) => { - const keysMatch = partial || Object.keys(m).length === Object.keys(msg).length; - return keysMatch && Object.keys(msg).every( - (k) => (m)[k] === (msg)[k] - ); + function genTest(autoAction: AutoAction) { + test(`${url.split("://")[1]} .${testRegion} ${autoAction}`, async ({ page }) => { + if (options.onlyRegions && options.onlyRegions.length > 0 && !options.onlyRegions.includes(testRegion)) { + test.skip(); + } + if (options.skipRegions && options.skipRegions.includes(testRegion)) { + test.skip(); + } + enableLogs && page.on('console', async msg => { + console.log(` page log:`, msg.text()); }); - } - - let selfTestFrame: Frame = null; - async function messageCallback({ frame }: { frame: Frame }, msg: ContentScriptMessage) { - enableLogs && msg.type !== 'eval' && console.log(msg); - received.push(msg); - switch (msg.type) { - case 'optInResult': - case 'optOutResult': { - if (msg.scheduleSelfTest) { - selfTestFrame = frame; + await page.exposeBinding("autoconsentSendMessage", messageCallback); + await page.goto(url, { waitUntil: "commit" }); + + // set up a messaging function + const received: ContentScriptMessage[] = []; + + function isMessageReceived(msg: Partial, partial = true) { + return received.some((m) => { + const keysMatch = partial || Object.keys(m).length === Object.keys(msg).length; + return keysMatch && Object.keys(msg).every( + (k) => (m)[k] === (msg)[k] + ); + }); + } + + let selfTestFrame: Frame = null; + async function messageCallback({ frame }: { frame: Frame }, msg: ContentScriptMessage) { + enableLogs && msg.type !== 'eval' && console.log(msg); + received.push(msg); + switch (msg.type) { + case 'init': { + await frame.evaluate(`autoconsentReceiveMessage({ type: "initResp", config: ${JSON.stringify({ + enabled: true, + autoAction: autoAction, + disabledCmps: [], + enablePrehide: true, + detectRetries: 20, + })} })`); + break; } - break; - } - case 'autoconsentDone': { - if (selfTestFrame && options.testSelfTest) { - await selfTestFrame.evaluate(`autoconsentReceiveMessage({ type: "selfTest" })`); + case 'optInResult': + case 'optOutResult': { + if (msg.scheduleSelfTest) { + selfTestFrame = frame; + } + break; + } + case 'autoconsentDone': { + if (selfTestFrame && options.testSelfTest) { + await selfTestFrame.evaluate(`autoconsentReceiveMessage({ type: "selfTest" })`); + } + break; + } + case 'eval': { + const result = await frame.evaluate(msg.code); + await frame.evaluate(`autoconsentReceiveMessage({ id: "${msg.id}", type: "evalResp", result: ${JSON.stringify(result)} })`); + break; + } + case 'autoconsentError': { + console.error(url, msg.details); + break; } - break; - } - case 'eval': { - const result = await frame.evaluate(msg.code); - await frame.evaluate(`autoconsentReceiveMessage({ id: "${msg.id}", type: "evalResp", result: ${JSON.stringify(result)} })`); - break; - } - case 'autoconsentError': { - console.error(url, msg.details); - break; } } - } - - // inject content scripts into every frame - await injectContentScript(page); - page.frames().forEach(injectContentScript); - page.on("framenavigated", injectContentScript); - - // wait for all messages and assertions - await waitFor(() => isMessageReceived({ type: "popupFound", cmp: expectedCmp }), 50, 500); - expect(isMessageReceived({ type: "popupFound", cmp: expectedCmp })).toBe(true); - - if (options.testOptOut) { - await waitFor(() => isMessageReceived({ type: "optOutResult", result: true }), 50, 300); - expect(isMessageReceived({ type: "optOutResult", result: true })).toBe(true); - } - if (options.testSelfTest && selfTestFrame) { - await waitFor(() => isMessageReceived({ type: "selfTestResult", result: true }), 50, 300); - expect(isMessageReceived({ type: "selfTestResult", result: true })).toBe(true); - } - await waitFor(() => isMessageReceived({ type: "autoconsentDone" }), 10, 500); - expect(isMessageReceived({ type: "autoconsentDone" })).toBe(true); - - expect(isMessageReceived({ type: "autoconsentError" })).toBe(false); - }); + + // inject content scripts into every frame + await injectContentScript(page); + page.frames().forEach(injectContentScript); + page.on("framenavigated", injectContentScript); + + // wait for all messages and assertions + await waitFor(() => isMessageReceived({ type: "popupFound", cmp: expectedCmp }), 50, 500); + expect(isMessageReceived({ type: "popupFound", cmp: expectedCmp })).toBe(true); + + if (autoAction === 'optOut') { + await waitFor(() => isMessageReceived({ type: "optOutResult", result: true }), 50, 300); + expect(isMessageReceived({ type: "optOutResult", result: true })).toBe(true); + } + if (autoAction === 'optIn') { + await waitFor(() => isMessageReceived({ type: "optInResult", result: true }), 50, 300); + expect(isMessageReceived({ type: "optInResult", result: true })).toBe(true); + } + if (options.testSelfTest && selfTestFrame) { + await waitFor(() => isMessageReceived({ type: "selfTestResult", result: true }), 50, 300); + expect(isMessageReceived({ type: "selfTestResult", result: true })).toBe(true); + } + await waitFor(() => isMessageReceived({ type: "autoconsentDone" }), 10, 500); + expect(isMessageReceived({ type: "autoconsentDone" })).toBe(true); + + expect(isMessageReceived({ type: "autoconsentError" })).toBe(false); + }) + } + + if (!options.testOptIn && !options.testOptOut) { + genTest(null); + } + + if (options.testOptIn) { + genTest('optIn'); + } + + if (options.testOptOut) { + genTest('optOut'); + } } export default function generateCMPTests( diff --git a/playwright/standalone.ts b/playwright/standalone.ts deleted file mode 100644 index 03ed5b2b..00000000 --- a/playwright/standalone.ts +++ /dev/null @@ -1,36 +0,0 @@ -import AutoConsent from "../lib/web"; -import { BackgroundMessage } from "../lib/messages"; -import { Config, RuleBundle } from "../lib/types"; -import * as rules from '../rules/rules.json'; - -declare global { - interface Window { - initAutoconsentStandalone: () => void; - autoconsentStandaloneSendMessage: (msg: string) => void; - autoconsentStandaloneReceiveMessage: (message: BackgroundMessage) => void; - } -} - - -window.initAutoconsentStandalone = (config: Config = { - enabled: true, - autoAction: 'optOut', - disabledCmps: [], - enablePrehide: true, - detectRetries: 20, -}) => { - if (!window.autoconsentStandaloneReceiveMessage) { - const autoconsent = new AutoConsent( - async message => { - window.autoconsentStandaloneSendMessage(JSON.stringify(message)); - }, - config, - rules - ); - window.autoconsentStandaloneReceiveMessage = (msg) => { - autoconsent.receiveMessageCallback(msg); - } - } else { - console.warn('autoconsent already initialized', window.autoconsentStandaloneReceiveMessage); - } -} diff --git a/rollup.config.js b/rollup.config.js index 1a448e27..a26fc146 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -14,17 +14,6 @@ export default [{ typescript(), terser(), ] -}, { - input: './playwright/standalone.ts', - output: [{ - file: 'dist/autoconsent.standalone.js', - format: 'iife' - }], - plugins: [ - json(), - typescript(), - terser(), - ] }, { input: './lib/web.ts', output: [{ diff --git a/rules/autoconsent/ausopen.json b/rules/autoconsent/ausopen.json index 03719982..e2490702 100644 --- a/rules/autoconsent/ausopen.json +++ b/rules/autoconsent/ausopen.json @@ -3,5 +3,6 @@ "isHidingRule": true, "detectCmp": [{ "exists": ".gdpr-popup__message" }], "detectPopup": [{ "visible": ".gdpr-popup__message" }], - "optOut": [{ "hide": [".gdpr-popup__message"]}] + "optOut": [{ "hide": [".gdpr-popup__message"]}], + "optIn": [{ "click": [".gdpr-popup__message button"]}] } diff --git a/rules/autoconsent/cookie-law-info.json b/rules/autoconsent/cookie-law-info.json index e8eb4146..5862b2cc 100644 --- a/rules/autoconsent/cookie-law-info.json +++ b/rules/autoconsent/cookie-law-info.json @@ -3,7 +3,7 @@ "prehideSelectors": ["#cookie-law-info-bar"], "detectCmp": [{ "exists": "#cookie-law-info-bar" }], "detectPopup": [{ "visible": "#cookie-law-info-bar" }], - "optIn": [{ "click": "[data-cli_action=\"accept\"]" }], + "optIn": [{ "click": "[data-cli_action=\"accept_all\"]" }], "optOut": [ { "hide": ["#cookie-law-info-bar"] }, { diff --git a/rules/autoconsent/cookie-notice.json b/rules/autoconsent/cookie-notice.json index 7de1eaee..2985b43d 100644 --- a/rules/autoconsent/cookie-notice.json +++ b/rules/autoconsent/cookie-notice.json @@ -3,6 +3,6 @@ "prehideSelectors": ["#cookie-notice"], "detectCmp": [{ "exists": "#cookie-notice" }], "detectPopup": [{ "visible": "#cookie-notice" }], - "optIn": [{ "hide": ["#cn-accept-cookie"] }], + "optIn": [{ "click": ["#cn-accept-cookie"] }], "optOut": [{ "hide": ["#cookie-notice"] }] } diff --git a/rules/autoconsent/destatis-de.json b/rules/autoconsent/destatis-de.json index 097c67b8..909010bb 100644 --- a/rules/autoconsent/destatis-de.json +++ b/rules/autoconsent/destatis-de.json @@ -3,5 +3,6 @@ "prehideSelectors": ["div[aria-labelledby=cookiebannerhead]"], "detectCmp": [{ "exists": ".cookiebannerbox" }], "detectPopup": [{ "visible": ".cookiebannerbox" }], - "optOut": [{ "hide": [".cookiebannerbox"] }] + "optOut": [{ "hide": [".cookiebannerbox"] }], + "optIn": [{ "click": [".cookiebannerbox .close"] }] } diff --git a/rules/autoconsent/dunelm.json b/rules/autoconsent/dunelm.json index 960b7d48..aca74b80 100644 --- a/rules/autoconsent/dunelm.json +++ b/rules/autoconsent/dunelm.json @@ -3,7 +3,7 @@ "prehideSelectors": ["div[data-testid=cookie-consent-modal-backdrop]"], "detectCmp": [{ "exists": "div[data-testid=cookie-consent-message-contents]"}], "detectPopup": [{ "visible": "div[data-testid=cookie-consent-message-contents]" }], - "optIn": [{ "click": "" }], + "optIn": [{ "click": "[data-testid=\"cookie-consent-allow-all\"]" }], "optOut": [ { "click": "button[data-testid=cookie-consent-adjust-settings]" diff --git a/rules/autoconsent/marksandspencer.json b/rules/autoconsent/marksandspencer.json index db37dae5..e1e0313c 100644 --- a/rules/autoconsent/marksandspencer.json +++ b/rules/autoconsent/marksandspencer.json @@ -3,5 +3,6 @@ "isHidingRule": true, "detectCmp": [{ "exists": ".navigation-cookiebbanner" }], "detectPopup": [{ "visible": ".navigation-cookiebbanner" }], - "optOut": [{ "hide": [".navigation-cookiebbanner"]}] + "optOut": [{ "hide": [".navigation-cookiebbanner"]}], + "optIn": [{ "click": [".navigation-cookiebbanner__submit"]}] } diff --git a/rules/autoconsent/mediamarkt-de.json b/rules/autoconsent/mediamarkt-de.json index 4505ca25..0709d1ba 100644 --- a/rules/autoconsent/mediamarkt-de.json +++ b/rules/autoconsent/mediamarkt-de.json @@ -7,5 +7,5 @@ "detectCmp": [{"exists": "div[aria-labelledby^=pwa-consent-layer-title]"}], "detectPopup": [{"exists": "div[aria-labelledby^=pwa-consent-layer-title]"}], "optOut": [{"click": "button[data-test^=pwa-consent-layer-deny-all]"}], - "optIn": [{"click": "'button[data-test^=pwa-consent-layer-accept-all'"}] + "optIn": [{"click": "button[data-test^=pwa-consent-layer-accept-all"}] } diff --git a/rules/autoconsent/microsoft.json b/rules/autoconsent/microsoft.json index 48436095..4e3a9364 100644 --- a/rules/autoconsent/microsoft.json +++ b/rules/autoconsent/microsoft.json @@ -4,6 +4,6 @@ "detectCmp": [{ "exists": "#wcpConsentBannerCtrl" }], "detectPopup": [{ "exists": "#wcpConsentBannerCtrl" }], "optOut": [{ "eval": "Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Reject|Ablehnen'))[0].click() || true" }], - "optIn": [{ "eval": "Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Accept|Annehmen'))[0].click()" }], + "optIn": [{ "eval": "Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Accept|Annehmen'))[0].click() || true" }], "test": [{ "eval": "!!document.cookie.match('MSCC')"}] } diff --git a/rules/autoconsent/osano.json b/rules/autoconsent/osano.json index 8c37a865..909fcdfc 100644 --- a/rules/autoconsent/osano.json +++ b/rules/autoconsent/osano.json @@ -3,7 +3,10 @@ "prehideSelectors": [".osano-cm-window"], "detectCmp": [{ "exists": ".osano-cm-window" }], "detectPopup": [{ "visible": ".osano-cm-dialog" }], - "optIn": [{ "click": ".osano-cm-accept-all" }], + "optIn": [{ + "click": ".osano-cm-accept-all", + "optional": true + }], "optOut": [ { "hide": [".osano-cm-window"] } ] diff --git a/rules/autoconsent/snigel.json b/rules/autoconsent/snigel.json index 9fe3b2fe..8bb5a350 100644 --- a/rules/autoconsent/snigel.json +++ b/rules/autoconsent/snigel.json @@ -3,5 +3,6 @@ "detectCmp": [{ "exists": ".snigel-cmp-framework" }], "detectPopup": [{ "visible": ".snigel-cmp-framework" }], "optOut": [{ "click": "#sn-b-custom" }, {"click": "#sn-b-save"}], - "test": [{ "eval": "!!document.cookie.match('snconsent')"}] + "test": [{ "eval": "!!document.cookie.match('snconsent')"}], + "optIn": [{ "click": ".snigel-cmp-framework #accept-choices" }] } diff --git a/rules/autoconsent/thefreedictionary.json b/rules/autoconsent/thefreedictionary.json index 128b52f6..d736ae44 100644 --- a/rules/autoconsent/thefreedictionary.json +++ b/rules/autoconsent/thefreedictionary.json @@ -3,7 +3,7 @@ "prehideSelectors": ["#cmpBanner"], "detectCmp": [{ "exists": "#cmpBanner" }], "detectPopup": [{ "visible": "#cmpBanner" }], - "optIn": [{ "eval": "cmpUi.allowAll()" }], + "optIn": [{ "eval": "cmpUi.allowAll() || true" }], "optOut": [ { "eval": "cmpUi.showPurposes() || cmpUi.rejectAll() || true" diff --git a/tests/didomi.spec.ts b/tests/didomi.spec.ts index db26ee7f..11d3d6af 100644 --- a/tests/didomi.spec.ts +++ b/tests/didomi.spec.ts @@ -7,7 +7,7 @@ generateCMPTests('com_didomi.io', [ "http://www.allocine.fr/", "https://www.boursorama.com/", ], { - testOptOut: false, + testOptIn: false, testSelfTest: false, skipRegions: ["US"], }); diff --git a/tests/evidon.spec.ts b/tests/evidon.spec.ts index 7777b290..70a0b0da 100644 --- a/tests/evidon.spec.ts +++ b/tests/evidon.spec.ts @@ -1,6 +1,11 @@ import generateCMPTests from "../playwright/runner"; generateCMPTests('Evidon', [ - 'https://www.kia.com/us/en', 'https://www.fujitsu.com/global/' ]); + +generateCMPTests('Evidon', [ + 'https://www.kia.com/us/en', // "I agree" button is actually a decline button +], { + testOptIn: false, +}); diff --git a/tests/oil.spec.ts b/tests/oil.spec.ts index ef36ee74..a1384634 100644 --- a/tests/oil.spec.ts +++ b/tests/oil.spec.ts @@ -5,6 +5,6 @@ generateCMPTests('com_oil', [ 'https://www.nubert.de/', ], { skipRegions: ['GB'], - testOptOut: false, + testOptIn: false, testSelfTest: false, }); \ No newline at end of file diff --git a/tests/onetrust.spec.ts b/tests/onetrust.spec.ts index 87122628..ddd7f288 100644 --- a/tests/onetrust.spec.ts +++ b/tests/onetrust.spec.ts @@ -1,16 +1,32 @@ import generateCMPTests from "../playwright/runner"; generateCMPTests('Onetrust', [ - 'https://mailchimp.com/', 'https://stackoverflow.com/', 'https://www.zdf.de/', - "https://www.accenture.com/", "https://www.lovescout24.de/", "https://www.okcupid.com/", "https://doodle.com/", - 'https://www.zoom.us', ]); +generateCMPTests('Onetrust', [ + 'https://mailchimp.com/', + "https://www.accenture.com/", + 'https://www.zoom.us', +], { + testOptIn: false, +}); + +// opt-in is not necessary in the US on this sites +generateCMPTests('Onetrust', [ + 'https://mailchimp.com/', + "https://www.accenture.com/", + 'https://www.zoom.us', +], { + testOptIn: true, + testOptOut: false, + skipRegions: ['US'], +}); + generateCMPTests('Onetrust', [ 'https://arstechnica.com/', 'https://www.nvidia.com/', diff --git a/tests/quantcast.spec.ts b/tests/quantcast.spec.ts index 1c4c7892..0848d536 100644 --- a/tests/quantcast.spec.ts +++ b/tests/quantcast.spec.ts @@ -13,7 +13,7 @@ generateCMPTests('quantcast', [ generateCMPTests('com_quantcast2', [ 'https://www.fandom.com/', ], { - testOptOut: false, + testOptIn: false, testSelfTest: false, skipRegions: ["US"] }); diff --git a/tests/springer.spec.ts b/tests/springer.spec.ts index a40fc7d8..c1cb6f15 100644 --- a/tests/springer.spec.ts +++ b/tests/springer.spec.ts @@ -6,6 +6,6 @@ generateCMPTests('com_springer', [ 'https://www.onet.pl/', ], { skipRegions: ['GB'], - testOptOut: false, + testOptIn: false, testSelfTest: false, }); \ No newline at end of file diff --git a/tests/trustarc.spec.ts b/tests/trustarc.spec.ts index c9a7565d..433c347b 100644 --- a/tests/trustarc.spec.ts +++ b/tests/trustarc.spec.ts @@ -31,5 +31,6 @@ generateCMPTests('TrustArc-frame', [ ], { testOptOut: true, testSelfTest: false, + testOptIn: false, // opt-in works, but is triggered by the top frame skipRegions: ["US"] }); diff --git a/tests/wordpressgdpr.spec.ts b/tests/wordpressgdpr.spec.ts index 94b710dc..cb0438dd 100644 --- a/tests/wordpressgdpr.spec.ts +++ b/tests/wordpressgdpr.spec.ts @@ -3,6 +3,6 @@ import generateCMPTests from "../playwright/runner"; generateCMPTests('com_wordpressgdpr', [ 'https://www.yourpension.gov.uk/', ], { - testOptOut: false, + testOptIn: false, testSelfTest: false, }); \ No newline at end of file