Skip to content

Commit

Permalink
fix cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
rommelfreddy committed Apr 20, 2024
1 parent 8306022 commit c66db9a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Resources/app/storefront/cypress/commands/sales-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ Cypress.Commands.add('allowCurrencyForSalesChannel', (isoCode) => {
})
}).then(() => {
cy.visit('/'); // navigate to home, to make sure dropdown is visible
cy.get('.top-bar .currencies-menu').should($el => {
if ($el.length === 0) {
// if not exist, the currency is already selected, because it is the default
return;
cy.get('body').then($body => {
if ($body.find('.top-bar .currencies-menu').length) {
cy.get('.top-bar .currencies-menu > .dropdown-toggle').click();
cy.get('.top-bar .currencies-menu [title="' + isoCode + '"]').click();
}
cy.get('.top-bar .currencies-menu > .dropdown-toggle').click();
cy.get('.top-bar .currencies-menu [title="' + isoCode + '"]').click();
})
});
})
});

Expand Down

0 comments on commit c66db9a

Please sign in to comment.