Skip to content

Commit

Permalink
Fix the Canonical rule (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov authored Jan 26, 2024
1 parent b0ba99c commit f3436e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/eval-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const snippets = {
EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
EVAL_THEVERGE_0: () => document.cookie.includes('_duet_gdpr_acknowledged=1'),
EVAL_UBUNTU_COM_0: () => document.cookie === '_cookies_accepted=essential',
EVAL_UBUNTU_COM_0: () => document.cookie.includes('_cookies_accepted=essential'),
EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes('catAccCookies'),
EVAL_USERCENTRICS_API_0: () => typeof UC_UI === 'object',
EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
Expand Down
9 changes: 5 additions & 4 deletions rules/autoconsent/ubuntu.com.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,23 @@
{
"any": [
{
"waitForThenClick": "button.p-button"
"waitForThenClick": "button.js-manage"
},
{
"waitForThenClick": "xpath///*[@id=\"cookie-policy-content\"]/p[4]/button[2]"
}
]
},
{
"waitForThenClick": ".p-switch__input:checked",
"waitForThenClick": "dialog.cookie-policy .p-switch__input:checked",
"optional": true,
"all": true
"all": true,
"timeout": 500
},
{
"any": [
{
"waitForThenClick": "div > button"
"waitForThenClick": "dialog.cookie-policy .js-save-preferences"
},
{
"waitForThenClick": "xpath///*[@id=\"modal\"]/div/button"
Expand Down
2 changes: 2 additions & 0 deletions tests/ubuntu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ import generateCMPTests from "../playwright/runner";

generateCMPTests('ubuntu.com', [
'https://ubuntu.com/',
'https://canonical.com/',
'https://snapcraft.io/',
], {});

0 comments on commit f3436e1

Please sign in to comment.