Fixed merged tests

main
Boris Sekachev 5 years ago
parent b771780d68
commit bf21c29219

@ -8,7 +8,12 @@ import Button from 'antd/lib/button';
import Modal from 'antd/lib/modal';
import Tooltip from 'antd/lib/tooltip';
import Icon, {
LinkOutlined, CopyOutlined, BlockOutlined, GatewayOutlined, RetweetOutlined, DeleteOutlined,
LinkOutlined,
CopyOutlined,
BlockOutlined,
GatewayOutlined,
RetweetOutlined,
DeleteOutlined,
} from '@ant-design/icons';
import {
BackgroundIcon, ForegroundIcon, ResetPerspectiveIcon, ColorizeIcon,
@ -200,7 +205,7 @@ function RemoveItem(props: ItemProps): JSX.Element {
onClick={(): void => {
if (locked) {
Modal.confirm({
className: 'cvat-modal-confirm',
className: 'cvat-modal-confirm',
title: 'Object is locked',
content: 'Are you sure you want to remove it?',
onOk() {

@ -23,66 +23,58 @@ context('Delete unlock/lock object', () => {
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('.cvat_canvas_shape').trigger('mousemove').should('have.class', 'cvat_canvas_shape_activated');
});
};
cy.get('body')
.type(shortcut);
};
}
cy.get('body').type(shortcut);
}
function clickRemoveOnDropdownMenu() {
cy.get('.cvat-object-item-menu')
.contains(new RegExp('^Remove$', 'g'))
.click({ force: true });
};
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();
cy.get('span[aria-label="more"]').click();
});
});
clickRemoveOnDropdownMenu();
};
}
function deleteObjectViaGUIFromObject() {
cy.get('.cvat-canvas-container').within(() => {
cy.get('.cvat_canvas_shape')
.trigger('mousemove')
.rightclick();
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();
cy.get('span[aria-label="more"]').click();
});
});
clickRemoveOnDropdownMenu();
};
}
function actionOnConfirmWindow(textBuntton) {
cy.get('.cvat-modal-confirm').within(() => {
cy.contains(new RegExp(`^${textBuntton}$`, 'g'))
.click();
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);

Loading…
Cancel
Save