-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2518 from dvkruchinin/dkru/cypress-test-issue-2486
Cypress test. Check ability to edit positions in AAM.
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
tests/cypress/integration/actions_tasks_objects/issue_2486_not_edit_object_aam.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,63 @@ | ||
// Copyright (C) 2020 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { taskName, labelName } from '../../support/const'; | ||
|
||
context("Object can't be draggable/resizable in AAM", () => { | ||
const issueId = '2486'; | ||
const createRectangleShape2Points = { | ||
points: 'By 2 Points', | ||
type: 'Shape', | ||
labelName: labelName, | ||
firstX: 250, | ||
firstY: 350, | ||
secondX: 350, | ||
secondY: 450, | ||
}; | ||
|
||
let shapeXPos = 0; | ||
|
||
before(() => { | ||
cy.openTaskJob(taskName); | ||
}); | ||
|
||
describe(`Testing issue "${issueId}"`, () => { | ||
it('Create, acttivate a object', () => { | ||
cy.createRectangle(createRectangleShape2Points); | ||
cy.get('#cvat_canvas_shape_1') | ||
.should('not.have.class', 'cvat_canvas_shape_activated') | ||
.trigger('mousemove') | ||
.should('have.class', 'cvat_canvas_shape_activated'); | ||
}); | ||
|
||
it('Go to AAM', () => { | ||
cy.changeWorkspace('Attribute annotation', labelName); | ||
cy.get('#cvat_canvas_shape_1') | ||
.then((shape) => { | ||
shapeXPos = Math.floor(shape.attr('x')); | ||
}) | ||
.trigger('mousemove') | ||
.should('not.have.class', 'cvat_canvas_shape_activated'); | ||
cy.get('circle').then((circle) => { | ||
for (let i = 0; i < circle.length; i++) { | ||
if (circle[i].id.match(/^SvgjsCircle\d+$/)) { | ||
cy.get(circle[i]).should('not.exist'); // id='SvgjsCircleNNNN' should not exist. Because of this can't change the object size. | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
it('Try to move/resize the object', () => { | ||
cy.get('.cvat-canvas-container') | ||
.trigger('mousedown', { button: 0 }) | ||
.trigger('mousemove', 550, 251) | ||
.trigger('mouseup'); | ||
cy.get('#cvat_canvas_shape_1').then((shapeAam) => { | ||
expect(shapeXPos).to.be.equal(Math.floor(shapeAam.attr('x'))); // The object didn't move. | ||
}); | ||
}); | ||
}); | ||
}); |