Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pandectes CMP #632

Merged
merged 4 commits into from
Feb 12, 2025
Merged

Add Pandectes CMP #632

merged 4 commits into from
Feb 12, 2025

Conversation

noisysocks
Copy link
Contributor

https://app.asana.com/0/1203268166580279/1207386274532820
https://app.asana.com/0/1203268166580279/1206854778035229

Pandectes seems to be built off of Complianz so there’s an argument that we could update e.g. complianz-optin to work with Pandectes cookie popups. I decided to write a new rule, though, because Pandectes has a completely custom Settings modal.

@noisysocks noisysocks added patch Increment the patch version when merged CMP labels Feb 10, 2025
@noisysocks noisysocks requested a review from muodov February 10, 2025 08:58
@noisysocks
Copy link
Contributor Author

Hm npm run test -- --grep pandectes seems to fail in webkit. Will look at it tomorrow.

],
"detectPopup": [
{
"visible": ".pd-cookie-banner-window"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the rule works fine, but this always returns true for me, even when the popup is actually not visible, e.g. after a reload.
Note that the visibility check is a hack, and it doesn't always work. See also https://app.asana.com/0/1201844467387842/1202597302683964

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I’ll use the other selector. 6e67680

@noisysocks noisysocks requested a review from muodov February 11, 2025 23:24
{ "click": "#pandectes-banner .cc-settings" },
{ "waitForThenClick": ".pd-cp-ui-rejectAll" },
{ "click": ".pd-cp-ui-save" },
{ "wait": 200 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s a slight delay in setting the cookie in Webkit which is why unit tests were failing. This line fixes it, but maybe there’s a better way? One option could be to make selfTest retry a few times.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, given I can’t reproduce this issue when actually using Safari/Webkit, it only seems to prop up in the tests, maybe a better fix is to have the test runner wait before running selfTest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided on moving the wait to test as it looks like we do that in a few other rules: youtube, testcmp-cosmetic, paypal, openai.

@noisysocks
Copy link
Contributor Author

Local tests pass now!

Copy link
Member

@muodov muodov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, thanks @noisysocks !

@muodov muodov merged commit ceace8b into main Feb 12, 2025
7 checks passed
@muodov muodov deleted the pandectes-cmp branch February 12, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMP patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants