-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug: Incorrect point deletion with keyboard shortcut (#4420)
* fixed incorrect deletion * update changelog * added test * applied comments * added small check
- Loading branch information
Showing
5 changed files
with
120 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
tests/cypress/integration/issues_prs2/issue_3821_delete_point.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { taskName, labelName } from '../../support/const'; | ||
|
||
context('When delete a point, the required point is deleted.', () => { | ||
const issueId = '3821'; | ||
|
||
const pointsShapes = []; | ||
for (let i = 0; i < 4; i++) { | ||
pointsShapes.push({ | ||
labelName, | ||
type: 'Shape', | ||
pointsMap: [ | ||
{ x: 300 + i * 50, y: 250 }, | ||
{ x: 300 + i * 50, y: 350 }, | ||
{ x: 300 + i * 50, y: 450 }, | ||
], | ||
}); | ||
} | ||
|
||
before(() => { | ||
cy.openTaskJob(taskName); | ||
pointsShapes.forEach((shape) => { | ||
cy.createPoint(shape); | ||
}); | ||
}); | ||
|
||
describe(`Testing issue "${issueId}"`, () => { | ||
it('Remove point holding Alt key from each shape. Point must be removed from first shape, second one should stay the same', () => { | ||
cy.get('#cvat_canvas_shape_1').trigger('mousemove', { force: true }).trigger('mouseover', { force: true }); | ||
cy.get('body').type('{alt}', { release: false }); | ||
cy.get('#cvat_canvas_shape_1') | ||
.children() | ||
.then((children) => { | ||
cy.get(children) | ||
.eq(1) | ||
.then((point) => { | ||
cy.get(point).click(); | ||
}); | ||
}); | ||
cy.get('#cvat_canvas_shape_2') | ||
.children() | ||
.then((children) => { | ||
cy.get(children) | ||
.eq(1) | ||
.then((point) => { | ||
cy.get(point).click(); | ||
}); | ||
}); | ||
cy.get('#cvat_canvas_shape_1') | ||
.children() | ||
.should('have.length', 2); | ||
cy.get('#cvat_canvas_shape_2') | ||
.children() | ||
.should('have.length', 3); | ||
}); | ||
|
||
it('Remove point holding Ctrl key from each shape. Point must be removed from first shape, second one should stay the same', () => { | ||
cy.get('#cvat_canvas_shape_3').trigger('mousemove', { force: true }).trigger('mouseover', { force: true }); | ||
cy.get('body').type('{ctrl}', { release: false }); | ||
cy.get('#cvat_canvas_shape_3') | ||
.children() | ||
.then((children) => { | ||
cy.get(children) | ||
.eq(1) | ||
.then((point) => { | ||
cy.get(point).rightclick(); | ||
}); | ||
}); | ||
cy.contains('Delete point').click(); | ||
cy.get('#cvat_canvas_shape_4') | ||
.children() | ||
.then((children) => { | ||
cy.get(children) | ||
.eq(1) | ||
.then((point) => { | ||
cy.get(point).rightclick(); | ||
}); | ||
}); | ||
cy.contains('Delete point').should('not.exist'); | ||
cy.get('#cvat_canvas_shape_3') | ||
.children() | ||
.should('have.length', 2); | ||
cy.get('#cvat_canvas_shape_4') | ||
.children() | ||
.should('have.length', 3); | ||
}); | ||
}); | ||
}); |