From fc6525eeb7ed737da1d556cc7f88977f870ce480 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin Date: Fri, 14 Jan 2022 09:57:38 +0300 Subject: [PATCH] Cypress test. Adjust, enabling tests for issues 2524 2633. (#4166) * Update the command * Rework the test Co-authored-by: dvkruchinin --- ...t_after_change_task_issue_point_firefox.js | 35 +++---------------- .../support/commands_review_pipeline.js | 4 ++- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/tests/cypress/integration/actions_users/issue_2524_2633_issue_not_reset_after_change_task_issue_point_firefox.js b/tests/cypress/integration/actions_users/issue_2524_2633_issue_not_reset_after_change_task_issue_point_firefox.js index eb8e2242..9c0e34fe 100644 --- a/tests/cypress/integration/actions_users/issue_2524_2633_issue_not_reset_after_change_task_issue_point_firefox.js +++ b/tests/cypress/integration/actions_users/issue_2524_2633_issue_not_reset_after_change_task_issue_point_firefox.js @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2021 Intel Corporation +// Copyright (C) 2020-2022 Intel Corporation // // SPDX-License-Identifier: MIT @@ -41,7 +41,6 @@ context('Some parts of the Redux state (issues) is not reset after changing a ta }; before(() => { - cy.clearLocalStorageSnapshot(); cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount); cy.createZipArchive(directoryToArchive, archivePath); cy.visit('/'); @@ -52,44 +51,19 @@ context('Some parts of the Redux state (issues) is not reset after changing a ta }); beforeEach(() => { - cy.restoreLocalStorage(); - }); - - afterEach(() => { - cy.saveLocalStorage(); + Cypress.Cookies.preserveOnce('sessionid', 'csrftoken'); }); after(() => { cy.goToTaskList(); cy.deleteTask(taskName.firstTaskName); - cy.reload(); - cy.closeModalUnsupportedPlatform(); cy.deleteTask(taskName.secondTaskName); }); describe(`Testing "${labelName}"`, () => { - // FIXME: review pipeline was redesigned. Need to adjust the test - it.skip('Open first task and request to review.', () => { - cy.openTaskJob(taskName.firstTaskName); - cy.interactMenu('Request a review'); - cy.get('.cvat-request-review-dialog') - .should('exist') - .within(() => { - cy.get('.cvat-user-search-field').click(); - }); - cy.get('.ant-select-dropdown').within(() => { - // eslint-disable-next-line security/detect-non-literal-regexp - cy.contains(new RegExp(`^${Cypress.env('user')}`)).click(); - }); - cy.contains('.cvat-request-review-dialog', 'Reviewer:').within(() => { - cy.contains('[type="button"]', 'Submit').click(); - }); - cy.url().should('include', '/tasks'); - }); - - // FIXME: review pipeline was redesigned. Need to adjust the test - it.skip('Open job again and create an issue. Check issue 2633.', () => { + it('Create an issue. Check issue 2633.', () => { cy.openTaskJob(taskName.firstTaskName); + cy.changeWorkspace('Review'); cy.createIssueFromControlButton(createIssueRectangle); cy.createIssueFromControlButton(createIssuePoint); // Issue 2633 }); @@ -98,6 +72,7 @@ context('Some parts of the Redux state (issues) is not reset after changing a ta cy.goToTaskList(); cy.openTaskJob(taskName.secondTaskName); cy.get('.cvat-hidden-issue-label').should('not.exist'); + cy.get('.cvat_canvas_issue_region').should('not.exist'); }); }); }); diff --git a/tests/cypress/support/commands_review_pipeline.js b/tests/cypress/support/commands_review_pipeline.js index b40769df..75fbe3c9 100644 --- a/tests/cypress/support/commands_review_pipeline.js +++ b/tests/cypress/support/commands_review_pipeline.js @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2021 Intel Corporation +// Copyright (C) 2020-2022 Intel Corporation // // SPDX-License-Identifier: MIT @@ -146,10 +146,12 @@ Cypress.Commands.add('createIssueFromControlButton', (createIssueParams) => { .trigger('mousedown', createIssueParams.firstX, createIssueParams.firstY, { button: 0 }) .trigger('mouseup'); } + cy.intercept('POST', '/api/v1/issues?*').as('issues'); cy.get('.cvat-create-issue-dialog').within(() => { cy.get('#issue_description').type(createIssueParams.description); cy.get('[type="submit"]').click(); }); + cy.wait('@issues').its('response.statusCode').should('equal', 201); cy.checkIssueRegion(); });