From d18fbae3ef2192d5d893bba25208be0ec75cd34d Mon Sep 17 00:00:00 2001 From: alexm <alexm@verdnatura.es> Date: Mon, 17 Mar 2025 10:02:44 +0100 Subject: [PATCH 1/2] test: skip 'not user' test suite in logout.spec.js --- test/cypress/integration/outLogin/logout.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/integration/outLogin/logout.spec.js b/test/cypress/integration/outLogin/logout.spec.js index b3583e4d3..377fcf77e 100644 --- a/test/cypress/integration/outLogin/logout.spec.js +++ b/test/cypress/integration/outLogin/logout.spec.js @@ -11,7 +11,7 @@ describe('Logout', () => { cy.get('#logout').click(); }); }); - describe('not user', () => { + describe.skip('not user', () => { beforeEach(() => { cy.intercept('GET', '**StarredModules**', { statusCode: 401, From 68b42c4c4e33cacd84393d578e717220a50d295a Mon Sep 17 00:00:00 2001 From: alexm <alexm@verdnatura.es> Date: Mon, 17 Mar 2025 10:35:53 +0100 Subject: [PATCH 2/2] test: enable 'not user' test suite in logout.spec.js and improve element visibility checks --- test/cypress/integration/outLogin/logout.spec.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/cypress/integration/outLogin/logout.spec.js b/test/cypress/integration/outLogin/logout.spec.js index 377fcf77e..b17e42794 100644 --- a/test/cypress/integration/outLogin/logout.spec.js +++ b/test/cypress/integration/outLogin/logout.spec.js @@ -2,7 +2,7 @@ describe('Logout', () => { beforeEach(() => { cy.login('developer'); - cy.visit(`/#/dashboard`, false); + cy.visit(`/#/dashboard`); cy.waitForElement('.q-page', 6000); }); describe('by user', () => { @@ -11,7 +11,7 @@ describe('Logout', () => { cy.get('#logout').click(); }); }); - describe.skip('not user', () => { + describe('not user', () => { beforeEach(() => { cy.intercept('GET', '**StarredModules**', { statusCode: 401, @@ -28,17 +28,10 @@ describe('Logout', () => { }); 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.get('.q-list').should('be.visible').first().should('be.visible').click(); cy.wait('@badRequest'); cy.checkNotification('Authorization Required'); - - Cypress.off('uncaught:exception', exceptionHandler); }); }); });