Skip to content

Commit

Permalink
Add rule for Gravito (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov authored Jan 31, 2025
1 parent 0482c1e commit 7ef3890
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/eval-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export const snippets = {
EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
EVAL_FIDES_DETECT_POPUP: () => window.Fides?.initialized,
EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
EVAL_GRAVITO_TEST: () => document.cookie.includes('gravitoData'),
EVAL_HEMA_TEST_0: () => document.cookie.includes('cookies_rejected=1'),
EVAL_IUBENDA_0: () =>
document.querySelectorAll('.purposes-item input[type=checkbox]:not([disabled])').forEach((x) => {
Expand Down
44 changes: 44 additions & 0 deletions rules/autoconsent/gravito.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "gravito",
"vendorUrl": "https://www.gravito.net/cmp/",
"prehideSelectors": [".gravitoCMP-background-overlay"],
"detectCmp": [
{
"exists": ".gravitoCMP-background-overlay"
}
],
"detectPopup": [
{
"visible": ".gravitoCMP-background-overlay"
}
],
"optIn": [
{
"waitForThenClick": "#modalConfirmBtn.gravitoCMP-button"
}
],
"optOut": [
{
"waitForThenClick": "#modalSettingBtn.gravitoCMP-button"
},
{
"waitFor": "#allRejectBtn"
},
{
"waitFor": ".gravitoCMP-content-section"
},
{
"click": ".gravitoCMP-content input[type=checkbox]:checked",
"all": true,
"optional": true
},
{
"waitForThenClick": "#allRejectBtn"
}
],
"test": [
{
"eval": "EVAL_GRAVITO_TEST"
}
]
}
3 changes: 3 additions & 0 deletions tests/gravito.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import generateCMPTests from '../playwright/runner';

generateCMPTests('gravito', ['https://www.hitta.se/']);

0 comments on commit 7ef3890

Please sign in to comment.