Skip to content

Commit 428c4dc

Browse files
maxMaxwellGarceau
authored andcommitted
Dismiss cookie modal if exists
1 parent 271f3aa commit 428c4dc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/cypress/e2e/connect.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ describe('Admin can connect to "Mailchimp" Account', () => {
2323
cy.get('#mailchimp_sf_oauth_connect').click();
2424
cy.wait(6000);
2525

26+
// Accept cookie consent popup window (if present)
27+
cy.popup().then(($popup) => {
28+
const acceptButtonSelector = '#onetrust-accept-btn-handler';
29+
30+
// Check if the accept button is visible and click it
31+
if ($popup.find(acceptButtonSelector).length > 0 && $popup.find(acceptButtonSelector).is(':visible')) {
32+
$popup.find(acceptButtonSelector).click();
33+
} else {
34+
cy.log('Cookie consent popup not found or not visible.');
35+
}
36+
});
37+
2638
cy.popup()
2739
.find('input#username')
2840
.clear()

0 commit comments

Comments
 (0)