diff --git a/features/autoconsent/filterlist.html b/features/autoconsent/filterlist.html new file mode 100644 index 0000000..5b4e303 --- /dev/null +++ b/features/autoconsent/filterlist.html @@ -0,0 +1,20 @@ + + +
+ + +Tests for filterlist-based hiding of cookie banners.
+ + + + + diff --git a/features/autoconsent/filterlist.js b/features/autoconsent/filterlist.js new file mode 100644 index 0000000..0003c75 --- /dev/null +++ b/features/autoconsent/filterlist.js @@ -0,0 +1,20 @@ +const acceptButton = document.createElement('button'); +acceptButton.innerText = 'Accept all'; +acceptButton.id = 'accept-all'; +const banner = document.quesrySelector('#privacy-test-page-cmp-test-banner-filterlist'); +banner.appendChild(acceptButton); +acceptButton.addEventListener('click', (ev) => { + ev.target.innerText = 'Accept was clicked!'; + window.results.results.push('accept_button_clicked'); +}); + +setTimeout(() => { + if (window.getComputedStyle(banner).opacity === '0') { + window.results.results.push('banner_hidden'); + } +}, 500); + +window.results = { + page: 'autoconsent-filterlist', + results: [] +}; diff --git a/index.html b/index.html index b2ef027..9ddf67a 100644 --- a/index.html +++ b/index.html @@ -43,6 +43,7 @@