diff --git a/test/cypress/integration/outLogin/logout.spec.js b/test/cypress/integration/outLogin/logout.spec.js index 373f0cc933c..b3583e4d355 100644 --- a/test/cypress/integration/outLogin/logout.spec.js +++ b/test/cypress/integration/outLogin/logout.spec.js @@ -24,12 +24,21 @@ describe('Logout', () => { }, }, statusMessage: 'AUTHORIZATION_REQUIRED', - }); + }).as('badRequest'); }); it('when token not exists', () => { + const exceptionHandler = (err) => { + if (err.code === 'AUTHORIZATION_REQUIRED') return; + }; + Cypress.on('uncaught:exception', exceptionHandler); + cy.get('.q-list').first().should('be.visible').click(); + cy.wait('@badRequest'); + cy.checkNotification('Authorization Required'); + + Cypress.off('uncaught:exception', exceptionHandler); }); }); }); diff --git a/test/cypress/support/index.js b/test/cypress/support/index.js index 87e869b6d94..b0f0fb3b125 100644 --- a/test/cypress/support/index.js +++ b/test/cypress/support/index.js @@ -40,6 +40,11 @@ style.innerHTML = ` `; document.head.appendChild(style); +// FIXME: https://redmine.verdnatura.es/issues/8771 +Cypress.on('uncaught:exception', (err) => { + if (err.code === 'ERR_CANCELED') return false; +}); + const waitForApiReady = (url, maxRetries = 20, delay = 1000) => { let retries = 0;