From 1ca2ea1ea79ba502e2b5ec5ad4323b9d0a792e32 Mon Sep 17 00:00:00 2001 From: dvkruchinin Date: Tue, 2 Feb 2021 11:28:02 +0300 Subject: [PATCH] Update Cypress test. Add issue as point for check issue 2633. --- ..._after_change_task_issue_point_firefox.js} | 19 +++++++++++++------ .../support/commands_review_pipeline.js | 6 ++++-- 2 files changed, 17 insertions(+), 8 deletions(-) rename tests/cypress/integration/actions_users/{issue_2524_issue_not_reset_after_change_task.js => issue_2524_2633_issue_not_reset_after_change_task_issue_point_firefox.js} (85%) diff --git a/tests/cypress/integration/actions_users/issue_2524_issue_not_reset_after_change_task.js b/tests/cypress/integration/actions_users/issue_2524_2633_issue_not_reset_after_change_task_issue_point_firefox.js similarity index 85% rename from tests/cypress/integration/actions_users/issue_2524_issue_not_reset_after_change_task.js rename to tests/cypress/integration/actions_users/issue_2524_2633_issue_not_reset_after_change_task_issue_point_firefox.js index 21442dbe5c37..7f515a56a700 100644 --- a/tests/cypress/integration/actions_users/issue_2524_issue_not_reset_after_change_task.js +++ b/tests/cypress/integration/actions_users/issue_2524_2633_issue_not_reset_after_change_task_issue_point_firefox.js @@ -1,15 +1,15 @@ -// Copyright (C) 2020 Intel Corporation +// Copyright (C) 2020-2021 Intel Corporation // // SPDX-License-Identifier: MIT /// context("Some parts of the Redux state (issues) isn't reset after chaning a task.", () => { - const issueId = '2524'; - const labelName = `Case ${issueId}`; + const issueId = '2524_2633'; + const labelName = `Issue ${issueId}`; const taskName = { - firstTaskName: 'First task issue 2524', - secondTaskName: 'Second task issue 2524', + firstTaskName: `First task issue ${issueId}`, + secondTaskName: `Second task issue ${issueId}`, }; const attrName = `Attr for ${labelName}`; const textDefaultValue = 'Some default value for type Text'; @@ -33,6 +33,12 @@ context("Some parts of the Redux state (issues) isn't reset after chaning a task secondX: 650, secondY: 200, }; + const createIssuePoint = { + type: 'point', + description: 'point issue', + firstX: 500, + firstY: 300, + }; before(() => { cy.clearLocalStorageSnapshot(); @@ -83,9 +89,10 @@ context("Some parts of the Redux state (issues) isn't reset after chaning a task cy.url().should('include', '/tasks'); }); - it('Open job again and create an issue', () => { + it('Open job again and create an issue. Check issue 2633.', () => { cy.openJob(); cy.createIssueFromControlButton(createIssueRectangle); + cy.createIssueFromControlButton(createIssuePoint); // Issue 2633 }); it('Open the second task. Open job. Issue not exist.', () => { diff --git a/tests/cypress/support/commands_review_pipeline.js b/tests/cypress/support/commands_review_pipeline.js index 91425c359e78..026d95c58dce 100644 --- a/tests/cypress/support/commands_review_pipeline.js +++ b/tests/cypress/support/commands_review_pipeline.js @@ -1,4 +1,4 @@ -// Copyright (C) 2020 Intel Corporation +// Copyright (C) 2020-2021 Intel Corporation // // SPDX-License-Identifier: MIT @@ -120,7 +120,9 @@ Cypress.Commands.add('createIssueFromControlButton', (createIssueParams) => { .trigger('mousemove', createIssueParams.secondX, createIssueParams.secondY) .trigger('mouseup'); } else if (createIssueParams.type === 'point') { - cy.get('.cvat-canvas-container').click(createIssueParams.firstX, createIssueParams.firstY); + cy.get('.cvat-canvas-container') + .trigger('mousedown', createIssueParams.firstX, createIssueParams.firstY, { button: 0 }) + .trigger('mouseup'); } cy.get('.cvat-create-issue-dialog').within(() => { cy.get('#issue_description').type(createIssueParams.description);