Skip to content

Commit

Permalink
Dismiss cookie modal if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
max authored and MaxwellGarceau committed Jan 3, 2025
1 parent 271f3aa commit 428c4dc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/cypress/e2e/connect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ describe('Admin can connect to "Mailchimp" Account', () => {
cy.get('#mailchimp_sf_oauth_connect').click();
cy.wait(6000);

// Accept cookie consent popup window (if present)
cy.popup().then(($popup) => {
const acceptButtonSelector = '#onetrust-accept-btn-handler';

// Check if the accept button is visible and click it
if ($popup.find(acceptButtonSelector).length > 0 && $popup.find(acceptButtonSelector).is(':visible')) {
$popup.find(acceptButtonSelector).click();
} else {
cy.log('Cookie consent popup not found or not visible.');
}
});

cy.popup()
.find('input#username')
.clear()
Expand Down

0 comments on commit 428c4dc

Please sign in to comment.