test: enable 'not user' test suite in logout.spec.js and improve element visibility checks
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
parent
d18fbae3ef
commit
68b42c4c4e
|
@ -2,7 +2,7 @@
|
||||||
describe('Logout', () => {
|
describe('Logout', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/dashboard`, false);
|
cy.visit(`/#/dashboard`);
|
||||||
cy.waitForElement('.q-page', 6000);
|
cy.waitForElement('.q-page', 6000);
|
||||||
});
|
});
|
||||||
describe('by user', () => {
|
describe('by user', () => {
|
||||||
|
@ -11,7 +11,7 @@ describe('Logout', () => {
|
||||||
cy.get('#logout').click();
|
cy.get('#logout').click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe.skip('not user', () => {
|
describe('not user', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.intercept('GET', '**StarredModules**', {
|
cy.intercept('GET', '**StarredModules**', {
|
||||||
statusCode: 401,
|
statusCode: 401,
|
||||||
|
@ -28,17 +28,10 @@ describe('Logout', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('when token not exists', () => {
|
it('when token not exists', () => {
|
||||||
const exceptionHandler = (err) => {
|
cy.get('.q-list').should('be.visible').first().should('be.visible').click();
|
||||||
if (err.code === 'AUTHORIZATION_REQUIRED') return;
|
|
||||||
};
|
|
||||||
Cypress.on('uncaught:exception', exceptionHandler);
|
|
||||||
|
|
||||||
cy.get('.q-list').first().should('be.visible').click();
|
|
||||||
cy.wait('@badRequest');
|
cy.wait('@badRequest');
|
||||||
|
|
||||||
cy.checkNotification('Authorization Required');
|
cy.checkNotification('Authorization Required');
|
||||||
|
|
||||||
Cypress.off('uncaught:exception', exceptionHandler);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue