test: fix intermitent e2e
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2025-03-14 12:41:26 +01:00
parent 0c2127f63f
commit 7899f7903f
2 changed files with 15 additions and 1 deletions

View File

@ -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);
});
});
});

View File

@ -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;