Merge branch 'develop' into bs/antd4_migration
commit
b771780d68
@ -0,0 +1,128 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { taskName, labelName } from '../../support/const';
|
||||
|
||||
context('Delete unlock/lock object', () => {
|
||||
const caseId = '24';
|
||||
|
||||
const createRectangleShape2Points = {
|
||||
points: 'By 2 Points',
|
||||
type: 'Shape',
|
||||
labelName: labelName,
|
||||
firstX: 100,
|
||||
firstY: 100,
|
||||
secondX: 300,
|
||||
secondY: 300,
|
||||
};
|
||||
|
||||
function lockObject() {
|
||||
cy.get('.cvat-objects-sidebar-state-item').within(() => {
|
||||
cy.get('.cvat-object-item-button-lock').click();
|
||||
});
|
||||
};
|
||||
|
||||
function deleteObjectViaShortcut(shortcut, stateLockObject) {
|
||||
if (stateLockObject == 'unlock') {
|
||||
cy.get('.cvat-canvas-container').within(() => {
|
||||
cy.get('.cvat_canvas_shape')
|
||||
.trigger('mousemove')
|
||||
.should('have.class', 'cvat_canvas_shape_activated');
|
||||
});
|
||||
};
|
||||
cy.get('body')
|
||||
.type(shortcut);
|
||||
};
|
||||
|
||||
function clickRemoveOnDropdownMenu() {
|
||||
cy.get('.cvat-object-item-menu')
|
||||
.contains(new RegExp('^Remove$', 'g'))
|
||||
.click({ force: true });
|
||||
};
|
||||
|
||||
function deleteObjectViaGUIFromSidebar() {
|
||||
cy.get('.cvat-objects-sidebar-states-list').within(() => {
|
||||
cy.get('.cvat-objects-sidebar-state-item').within(() => {
|
||||
cy.get('[aria-label="icon: more"]').click();
|
||||
});
|
||||
});
|
||||
clickRemoveOnDropdownMenu();
|
||||
};
|
||||
|
||||
function deleteObjectViaGUIFromObject() {
|
||||
cy.get('.cvat-canvas-container').within(() => {
|
||||
cy.get('.cvat_canvas_shape')
|
||||
.trigger('mousemove')
|
||||
.rightclick();
|
||||
});
|
||||
cy.get('.cvat-canvas-context-menu').within(() => {
|
||||
cy.get('.cvat-objects-sidebar-state-item').within(() => {
|
||||
cy.get('[aria-label="icon: more"]').click();
|
||||
});
|
||||
});
|
||||
clickRemoveOnDropdownMenu();
|
||||
};
|
||||
|
||||
function actionOnConfirmWindow(textBuntton) {
|
||||
cy.get('.cvat-modal-confirm').within(() => {
|
||||
cy.contains(new RegExp(`^${textBuntton}$`, 'g'))
|
||||
.click();
|
||||
});
|
||||
};
|
||||
|
||||
function checkFailDeleteLockObject(shortcut) {
|
||||
deleteObjectViaShortcut(shortcut, 'lock');
|
||||
checkExistObject('exist');
|
||||
cy.get('.cvat-notification-notice-remove-object-failed').should('exist');
|
||||
};
|
||||
|
||||
function checkExistObject(state) {
|
||||
cy.get('.cvat_canvas_shape').should(state);
|
||||
cy.get('.cvat-objects-sidebar-state-item').should(state);
|
||||
};
|
||||
|
||||
before(() => {
|
||||
cy.openTaskJob(taskName);
|
||||
});
|
||||
|
||||
describe(`Testing case "${caseId}"`, () => {
|
||||
it('Create and delete object via "Delete" shortcut', () => {
|
||||
cy.createRectangle(createRectangleShape2Points);
|
||||
deleteObjectViaShortcut('{del}', 'unlock');
|
||||
checkExistObject('not.exist');
|
||||
});
|
||||
|
||||
it('Create and delete object via GUI from sidebar', () => {
|
||||
cy.createRectangle(createRectangleShape2Points);
|
||||
deleteObjectViaGUIFromSidebar();
|
||||
checkExistObject('not.exist');
|
||||
});
|
||||
|
||||
it('Create, lock and delete object via "Shift+Delete" shortcuts', () => {
|
||||
cy.createRectangle(createRectangleShape2Points);
|
||||
lockObject();
|
||||
checkFailDeleteLockObject('{del}');
|
||||
deleteObjectViaShortcut('{shift}{del}', 'lock');
|
||||
checkExistObject('not.exist');
|
||||
});
|
||||
|
||||
it('Create, lock and delete object via GUI from sidebar', () => {
|
||||
cy.createRectangle(createRectangleShape2Points);
|
||||
lockObject();
|
||||
deleteObjectViaGUIFromSidebar();
|
||||
actionOnConfirmWindow('OK');
|
||||
checkExistObject('not.exist');
|
||||
});
|
||||
|
||||
it('Create, lock and cancel delete object via GUI from object', () => {
|
||||
cy.createRectangle(createRectangleShape2Points);
|
||||
lockObject();
|
||||
deleteObjectViaGUIFromObject();
|
||||
actionOnConfirmWindow('Cancel');
|
||||
checkExistObject('exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { taskName } from '../../support/const';
|
||||
|
||||
context('Canvas bitmap feature', () => {
|
||||
const caseId = '25';
|
||||
|
||||
before(() => {
|
||||
cy.openTaskJob(taskName);
|
||||
});
|
||||
|
||||
describe(`Testing case "${caseId}"`, () => {
|
||||
it('Bitmap not visible.', () => {
|
||||
cy.get('#cvat_canvas_bitmap').should('not.be.visible');
|
||||
});
|
||||
it('Activate bitmap.', () => {
|
||||
cy.get('.cvat-appearance-bitmap-checkbox').click();
|
||||
cy.get('#cvat_canvas_bitmap').should('be.visible').and('have.css', 'background-color', 'rgb(0, 0, 0)');
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,88 @@
|
||||
// Copyright (C) 2020 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { taskName, labelName } from '../../support/const';
|
||||
|
||||
context('Navigation to empty frames', () => {
|
||||
const issueId = '2485';
|
||||
const createRectangleShape2Points = {
|
||||
points: 'By 2 Points',
|
||||
type: 'Shape',
|
||||
labelName: labelName,
|
||||
firstX: 250,
|
||||
firstY: 350,
|
||||
secondX: 350,
|
||||
secondY: 450,
|
||||
};
|
||||
|
||||
before(() => {
|
||||
cy.openTaskJob(taskName);
|
||||
});
|
||||
|
||||
describe(`Testing issue "${issueId}"`, () => {
|
||||
it('Go to 2nd frame. Create a shape.', () => {
|
||||
cy.goCheckFrameNumber(2);
|
||||
cy.createRectangle(createRectangleShape2Points);
|
||||
});
|
||||
|
||||
it('Go to 4th frame. Create a shape.', () => {
|
||||
cy.goCheckFrameNumber(4);
|
||||
cy.createRectangle(createRectangleShape2Points);
|
||||
});
|
||||
|
||||
it('Input a filter to see the created objects.', () => {
|
||||
cy.writeFilterValue(false, 'shape=="rectangle"');
|
||||
cy.get('#cvat_canvas_shape_2').should('exist');
|
||||
});
|
||||
|
||||
it('Go to 3rd frame.', () => {
|
||||
cy.goCheckFrameNumber(3);
|
||||
});
|
||||
|
||||
it('Right click to navigation buttons: Previous, Next. Switch their mode to: Go next/previous with a filter.', () => {
|
||||
cy.goCheckFrameNumber(3);
|
||||
for (const i of ['previous', 'next']) {
|
||||
cy.get(`.cvat-player-${i}-button`).rightclick();
|
||||
cy.get(`.cvat-player-${i}-filtered-inlined-button`).click();
|
||||
}
|
||||
});
|
||||
|
||||
it("Press go previous with a filter. CVAT get 2nd frame. Press again. Frame wasn't changed.", () => {
|
||||
for (let i = 1; i <= 2; i++) {
|
||||
cy.get('.cvat-player-previous-button-filtered').click({ force: true });
|
||||
cy.checkFrameNum(2);
|
||||
cy.get('#cvat_canvas_shape_1').should('exist');
|
||||
}
|
||||
});
|
||||
|
||||
it("Press go next with a filter. CVAT get 4th frame. Press again. Frame wasn't changed.", () => {
|
||||
for (let i = 1; i <= 2; i++) {
|
||||
cy.get('.cvat-player-next-button-filtered').click({ force: true });
|
||||
cy.checkFrameNum(4);
|
||||
cy.get('#cvat_canvas_shape_2').should('exist');
|
||||
}
|
||||
});
|
||||
|
||||
it('Change navigation buttons mode to "Go next/previous to an empty frame".', () => {
|
||||
for (const i of ['previous', 'next']) {
|
||||
cy.get(`.cvat-player-${i}-button-filtered`).rightclick({ force: true });
|
||||
cy.get(`.cvat-player-${i}-empty-inlined-button`).click({ force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it('Go previous to an empty frame. CVAT get 3rd frame.', () => {
|
||||
cy.get('.cvat-player-previous-button-empty').click({ force: true });
|
||||
cy.checkFrameNum(3);
|
||||
cy.get('.cvat_canvas_shape').should('not.exist');
|
||||
});
|
||||
|
||||
it('Go next to an empty frame. CVAT get 5th frame.', () => {
|
||||
cy.get('.cvat-player-next-button-empty').click({ force: true });
|
||||
cy.checkFrameNum(5);
|
||||
cy.get('.cvat_canvas_shape').should('not.exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -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.
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue