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

[HOT Fix] Fix Facebook share button test #2737

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ describe('Social Share buttons on pages', { retries: { runMode: 4 } }, () => {

cy.get('[data-cy=btn-share-facebook]').first().click();
cy.get('@popup_facebook', { timeout: 8000 }).should('be.called');
cy.url().should('contain', `https://www.facebook.com/sharer/sharer.php?u=${canonicalUrl}`);
// Take into consideration that the Facebook share button can open a new window with two different URLs depending on the environment
cy.url().should(
'satisfy',
(url) =>
(url.includes('https://www.facebook.com/login.php') &&
url.includes('next=https%3A%2F%2Fwww.facebook.com%2Fsharer%2Fsharer.php')) ||
url.includes(`https://www.facebook.com/sharer/sharer.php?u=${canonicalUrl}`)
);
});
});
});