diff --git a/rules/autoconsent/ketch.json b/rules/autoconsent/ketch.json index 02a38ab6..3479acfc 100644 --- a/rules/autoconsent/ketch.json +++ b/rules/autoconsent/ketch.json @@ -20,30 +20,41 @@ ], "optIn": [ { - "click": "#lanyard_root button[class^='link']", - "optional": true - }, - { - "wait": 500 - }, - { - "waitForThenClick": "div[class^='buttons'] > :nth-child(2)" - }, - { - "click": "#lanyard_root button[class*='confirmButton']" + "if": { + "exists": "#lanyard_root button[class='confirmButton']" + }, + "then": [ + { "waitForThenClick":"#lanyard_root div[class^='buttons'] > :nth-child(2)" }, + { "click": "#lanyard_root button[class='confirmButton']" } + ], + "else": [ + { "waitForThenClick":"#lanyard_root div[class^='buttons'] > :nth-child(2)" } + ] } ], "optOut": [ - { + { "click": "#lanyard_root button[class^='link']", "optional": true }, { - "waitForThenClick": "#lanyard_root button[class*='rejectButton']" - }, - { - "click": "#lanyard_root button[class*='confirmButton']" + "if": { + "exists": "#lanyard_root button[class*='confirmButton']" + }, + "then": [ + { "waitForThenClick": "#lanyard_root button[class*='rejectButton']" }, + { "click": "#lanyard_root button[class*='confirmButton']" } + ], + "else": [ + { + "click": "#lanyard_root div[class^='buttons'] > :nth-child(1)", + "optional": true + }, + { "waitForThenClick": "#lanyard_root input:checked" }, + { "click": "#consentsTab > div:nth-child(2) > div > div[class^='actions'] > button:nth-child(1)" } + ] } ], "test": [] -} \ No newline at end of file + } + \ No newline at end of file diff --git a/tests/ketch.spec.ts b/tests/ketch.spec.ts index 022835bd..3b836294 100644 --- a/tests/ketch.spec.ts +++ b/tests/ketch.spec.ts @@ -3,4 +3,5 @@ import generateCMPTests from "../playwright/runner"; generateCMPTests("ketch", [ "https://www.smartsheet.com/", "https://www.ketch.com/", + "https://www.patreon.com/", ]);