diff --git a/tests/cypress/e2e/actions_projects_models/markdown_base_pipeline.js b/tests/cypress/e2e/actions_projects_models/markdown_base_pipeline.js index 13da4896fad..bbe3603f2a1 100644 --- a/tests/cypress/e2e/actions_projects_models/markdown_base_pipeline.js +++ b/tests/cypress/e2e/actions_projects_models/markdown_base_pipeline.js @@ -42,10 +42,9 @@ context('Basic markdown pipeline', () => { cy.visit('/'); cy.get('.cvat-login-form-wrapper').should('exist').and('be.visible'); - cy.clearCookies(); for (const user of Object.values(additionalUsers)) { cy.headlessCreateUser(user); - cy.clearCookies(); + cy.headlessLogout(); } cy.login(); diff --git a/tests/cypress/e2e/features/skeletons_pipeline.js b/tests/cypress/e2e/features/skeletons_pipeline.js index 0592158558f..e3b68669787 100644 --- a/tests/cypress/e2e/features/skeletons_pipeline.js +++ b/tests/cypress/e2e/features/skeletons_pipeline.js @@ -54,7 +54,7 @@ context('Manipulations with skeletons', { scrollBehavior: false }, () => { }); after(() => { - cy.clearAllCookies(); + cy.headlessLogout(); if (taskID !== null) { cy.getAuthKey().then((response) => { const authKey = response.body.key; diff --git a/tests/cypress/e2e/remove_users_tasks_projects_organizations.js b/tests/cypress/e2e/remove_users_tasks_projects_organizations.js index 624cc283195..d3f2890bedb 100644 --- a/tests/cypress/e2e/remove_users_tasks_projects_organizations.js +++ b/tests/cypress/e2e/remove_users_tasks_projects_organizations.js @@ -1,4 +1,5 @@ // Copyright (C) 2020-2022 Intel Corporation +// Copyright (C) CVAT.ai Corporation // // SPDX-License-Identifier: MIT @@ -6,10 +7,6 @@ let authKey = ''; -before(() => { - cy.clearAllCookies(); -}); - describe('Delete users, tasks, projects, organizations created during the tests run.', () => { it('Get token', () => { cy.request({ diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 792a873ceef..7dac05153f4 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -36,7 +36,7 @@ Cypress.Commands.add('logout', () => { cy.get('.cvat-header-menu-user-dropdown-user').click(); cy.get('span[aria-label="logout"]').click(); cy.url().should('include', '/auth/login'); - cy.clearAllCookies(); + cy.clearCookies(); cy.visit('/auth/login'); cy.url().should('not.include', '?next='); cy.contains('Sign in').should('exist'); @@ -369,8 +369,7 @@ Cypress.Commands.add('headlessCreateUser', (userSpec) => { }); Cypress.Commands.add('headlessLogout', () => { - cy.clearAllCookies(); - cy.clearAllLocalStorage(); + cy.clearCookies(); }); Cypress.Commands.add('headlessCreateJob', (jobSpec) => {