From 2fb69562ef25e56aa55bc77d16677605f390be4b Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Thu, 10 Sep 2020 10:45:37 +0300 Subject: [PATCH] Cypress test for issue 1216. (#2133) Co-authored-by: Dmitry Kruchinin --- ..._fails_with_shape_dragging_over_sidebar.js | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tests/cypress/integration/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js diff --git a/tests/cypress/integration/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js b/tests/cypress/integration/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js new file mode 100644 index 00000000..94b34e6a --- /dev/null +++ b/tests/cypress/integration/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + */ + +/// + +context('Check if UI not fails with shape dragging over sidebar', () => { + + const issueId = '1216' + const labelName = `Issue ${issueId}` + const taskName = `New annotation task for ${labelName}` + const attrName = `Attr for ${labelName}` + const textDefaultValue = 'Some default value for type Text' + const image = `image_${issueId}.png` + const width = 800 + const height = 800 + const posX = 10 + const posY = 10 + const color = 'gray' + + before(() => { + cy.visit('auth/login') + cy.login() + cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) + cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) + cy.openTaskJob(taskName) + }) + + describe(`Testing issue "${issueId}"`, () => { + it('Create multiple objects', () => { + /* The error was repeated when the number of + objects was more than or equal to 2 */ + cy.createShape(309, 431, 409, 531) + cy.createShape(200, 300, 300, 400) + }) + it('Shape dragging over sidebar.', () => { + /*To reproduce the error, move the any shape under any + #cvat-objects-sidebar-state-item-*. */ + cy.get('#cvat_canvas_shape_2') + .trigger('mousemove') + .trigger('mouseover') + .trigger('mousedown', {which: 1}) + }) + it('There is no error like "Canvas is busy. Action: drag" in the console', () => { + cy.get('body') + /*Since cy.click () contains events such as + mousemove, mouseover, etc. Use it to reduce lines of code.*/ + .click(1299, 300) + }) + }) +})