From d0c30e74a161998e989f21e2098e6fe07c86d7bd Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Thu, 1 Apr 2021 13:07:08 +0300 Subject: [PATCH] Cypress test. Crop polygon properly. (#3048) --- .../issue_2992_crop_polygon_properly.js | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/cypress/integration/actions_tasks_objects/issue_2992_crop_polygon_properly.js diff --git a/tests/cypress/integration/actions_tasks_objects/issue_2992_crop_polygon_properly.js b/tests/cypress/integration/actions_tasks_objects/issue_2992_crop_polygon_properly.js new file mode 100644 index 00000000..965bc528 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/issue_2992_crop_polygon_properly.js @@ -0,0 +1,36 @@ +// Copyright (C) 2020-2021 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName, labelName } from '../../support/const'; + +context('Crop polygon properly.', () => { + const issueId = '2992'; + + const createPolygonShape = { + reDraw: false, + type: 'Shape', + labelName: labelName, + pointsMap: [ + { x: 200, y: 500 }, + { x: 200, y: 200 }, + { x: 10, y: 250 }, + ], + complete: true, + numberOfPoints: null, + }; + + before(() => { + cy.openTaskJob(taskName); + }); + + describe(`Testing issue "${issueId}"`, () => { + it('Draw a polygon with vertices outside the image', () => { + cy.createPolygon(createPolygonShape); + cy.get('.cvat-canvas-container').click(58, 238); + cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated'); + }); + }); +});