Skip to content

Commit

Permalink
Slightly cleaned up cypress tests (#8975)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Jan 21, 2025
1 parent 23bcc89 commit cc4c910
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/features/skeletons_pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

/// <reference types="cypress" />

let authKey = '';

before(() => {
cy.clearAllCookies();
});

describe('Delete users, tasks, projects, organizations created during the tests run.', () => {
it('Get token', () => {
cy.request({
Expand Down
5 changes: 2 additions & 3 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -369,8 +369,7 @@ Cypress.Commands.add('headlessCreateUser', (userSpec) => {
});

Cypress.Commands.add('headlessLogout', () => {
cy.clearAllCookies();
cy.clearAllLocalStorage();
cy.clearCookies();
});

Cypress.Commands.add('headlessCreateJob', (jobSpec) => {
Expand Down

0 comments on commit cc4c910

Please sign in to comment.