From 08165c1b1781bb8f869a108007ed35bc2697eab5 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Tue, 24 Nov 2020 09:47:34 +0300 Subject: [PATCH 1/3] add test --- ..._error_canvas_is_busy_at_resize_element.js | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tests/cypress/integration/actions_tasks_objects/issue_1922_error_canvas_is_busy_at_resize_element.js diff --git a/tests/cypress/integration/actions_tasks_objects/issue_1922_error_canvas_is_busy_at_resize_element.js b/tests/cypress/integration/actions_tasks_objects/issue_1922_error_canvas_is_busy_at_resize_element.js new file mode 100644 index 00000000..ac68f7d4 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/issue_1922_error_canvas_is_busy_at_resize_element.js @@ -0,0 +1,61 @@ +// Copyright (C) 2020 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName, labelName } from '../../support/const'; + +context('Check error canvas is busy at resize element', () => { + + const issueId = '1922'; + const createRectangleShape2Points = { + points: 'By 2 Points', + type: 'Shape', + labelName: labelName, + firstX: 100, + firstY: 100, + secondX: 300, + secondY: 300, + }; + + before(() => { + cy.openTaskJob(taskName); + }); + + after('Remove annotations and save job', () => { + cy.removeAnnotations(); + cy.saveJob(); + }); + + describe(`Testing issue "${issueId}"`, () => { + it('Create an object in first frame', () => { + cy.createRectangle(createRectangleShape2Points); + }); + + it('Go to next frame and create an object in second frame', () => { + cy.get('.cvat-player-next-button').click(); + cy.createRectangle(createRectangleShape2Points); + }); + + it('Switching mode of button on "back with a filter"', () => { + cy.get('.cvat-player-previous-button').rightclick(); + cy.get('.cvat-player-previous-filtered-inlined-button').click(); + }); + + it('Resize element on second frame and go to previous frame at resizing element', () => { + let secondX = createRectangleShape2Points['secondX']; + let secondY = createRectangleShape2Points['secondY']; + cy.get('.cvat-canvas-container') + .trigger('mousemove', secondX - 10, secondY - 10) // activate second shape + .trigger('mousedown', secondX, secondY, {button: 0}) + .trigger('mousemove', secondX + 100, secondY + 100) + .get('body').type('d') // go to previous frame + .trigger('mouseup'); + }); + + it('Page with the error is missing', () => { + cy.get('.cvat-global-boundary').should('not.exist'); + }); + }); +}); From 60e60f1bb69c8529609ac2aed6dedf28332facc1 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Tue, 24 Nov 2020 11:14:21 +0300 Subject: [PATCH 2/3] added function saveJob --- tests/cypress/support/commands.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 695007b3..4a98be69 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -74,6 +74,12 @@ Cypress.Commands.add('openTask', (taskName) => { cy.contains('strong', taskName).parents('.cvat-tasks-list-item').contains('a', 'Open').click({ force: true }); }); +Cypress.Commands.add('saveJob', () => { + cy.get('button') + .contains('Save') + .click({ force: true }); +}); + Cypress.Commands.add('openJob', (jobNumber = 0) => { let tdText = ''; cy.get('.ant-table-tbody') From ef93bac40310731c6ecced2cf12dcd8b179cc613 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Tue, 24 Nov 2020 12:24:27 +0300 Subject: [PATCH 3/3] minor fix --- .../issue_1922_error_canvas_is_busy_at_resize_element.js | 9 ++------- tests/cypress/support/commands.js | 6 ------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/tests/cypress/integration/actions_tasks_objects/issue_1922_error_canvas_is_busy_at_resize_element.js b/tests/cypress/integration/actions_tasks_objects/issue_1922_error_canvas_is_busy_at_resize_element.js index ac68f7d4..ace78490 100644 --- a/tests/cypress/integration/actions_tasks_objects/issue_1922_error_canvas_is_busy_at_resize_element.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1922_error_canvas_is_busy_at_resize_element.js @@ -23,11 +23,6 @@ context('Check error canvas is busy at resize element', () => { cy.openTaskJob(taskName); }); - after('Remove annotations and save job', () => { - cy.removeAnnotations(); - cy.saveJob(); - }); - describe(`Testing issue "${issueId}"`, () => { it('Create an object in first frame', () => { cy.createRectangle(createRectangleShape2Points); @@ -44,8 +39,8 @@ context('Check error canvas is busy at resize element', () => { }); it('Resize element on second frame and go to previous frame at resizing element', () => { - let secondX = createRectangleShape2Points['secondX']; - let secondY = createRectangleShape2Points['secondY']; + const secondX = createRectangleShape2Points.secondX; + const secondY = createRectangleShape2Points.secondY; cy.get('.cvat-canvas-container') .trigger('mousemove', secondX - 10, secondY - 10) // activate second shape .trigger('mousedown', secondX, secondY, {button: 0}) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 4a98be69..695007b3 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -74,12 +74,6 @@ Cypress.Commands.add('openTask', (taskName) => { cy.contains('strong', taskName).parents('.cvat-tasks-list-item').contains('a', 'Open').click({ force: true }); }); -Cypress.Commands.add('saveJob', () => { - cy.get('button') - .contains('Save') - .click({ force: true }); -}); - Cypress.Commands.add('openJob', (jobNumber = 0) => { let tdText = ''; cy.get('.ant-table-tbody')