Fixed some of tests

main
Boris Sekachev 5 years ago
parent a627713bfc
commit 6505c01bc1

@ -22,6 +22,7 @@ function StatesOrderingSelectorComponent(props: StatesOrderingSelectorComponentP
<Text strong>Sort by</Text> <Text strong>Sort by</Text>
<Select <Select
className='cvat-objects-sidebar-ordering-selector' className='cvat-objects-sidebar-ordering-selector'
dropdownClassName='cvat-objects-sidebar-ordering-dropdown'
value={statesOrdering} value={statesOrdering}
onChange={changeStatesOrdering} onChange={changeStatesOrdering}
> >

@ -43,7 +43,12 @@ function RightGroup(props: Props): JSX.Element {
Info Info
</Button> </Button>
<div> <div>
<Select className='cvat-workspace-selector' onChange={changeWorkspace} value={workspace}> <Select
dropdownClassName='cvat-workspace-selector-dropdown'
className='cvat-workspace-selector'
onChange={changeWorkspace}
value={workspace}
>
{Object.values(Workspace).map((ws) => ( {Object.values(Workspace).map((ws) => (
<Select.Option key={ws} value={ws}> <Select.Option key={ws} value={ws}>
{ws} {ws}

@ -134,7 +134,6 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
public submit(): Promise<void> { public submit(): Promise<void> {
const { onSubmit } = this.props; const { onSubmit } = this.props;
if (this.formRef.current) { if (this.formRef.current) {
this.formRef.current.resetFields();
return this.formRef.current.validateFields().then( return this.formRef.current.validateFields().then(
(values: Store): Promise<void> => { (values: Store): Promise<void> => {
const frameFilter = values.frameStep ? `step=${values.frameStep}` : undefined; const frameFilter = values.frameStep ? `step=${values.frameStep}` : undefined;

@ -25,12 +25,13 @@ export default function LabelSelector(props: Props): JSX.Element {
return ( return (
<Select <Select
virtual={false}
{...rest} {...rest}
{...dinamicProps} {...dinamicProps}
showSearch showSearch
filterOption={(input: string, option?: OptionData | OptionGroupData) => { filterOption={(input: string, option?: OptionData | OptionGroupData) => {
if (option) { if (option) {
const { children } = option.props; const { children } = option;
if (typeof children === 'string') { if (typeof children === 'string') {
return children.toLowerCase().includes(input.toLowerCase()); return children.toLowerCase().includes(input.toLowerCase());
} }

@ -327,7 +327,7 @@ export default class LabelForm extends React.Component<Props> {
<Row <Row
justify='space-between' justify='space-between'
align='middle' align='middle'
cvat-attribute-id={key} cvat-attribute-id={fieldValue.id}
className='cvat-attribute-inputs-wrapper' className='cvat-attribute-inputs-wrapper'
> >
<Col span={5}>{this.renderAttributeNameInput(fieldInstance, attr)}</Col> <Col span={5}>{this.renderAttributeNameInput(fieldInstance, attr)}</Col>

@ -38,17 +38,18 @@ context('Actions on polygon', () => {
}); });
describe(`Testing case "${caseId}"`, () => { describe(`Testing case "${caseId}"`, () => {
it('Create a first polygon shape', () => { it('Create a first polygon shape', () => {
cy.createPolygon(createPolygonShapeFirst); cy.createPolygon(createPolygonShapeFirst);
}); });
it('Increase z-layer with a special switcher', () => { it('Increase z-layer with a special switcher', () => {
cy.get('.cvat-canvas-z-axis-wrapper').within(() => { cy.get('.cvat-canvas-z-axis-wrapper').within(() => {
cy.get('[role="slider"]').should('have.attr', 'aria-valuenow').then($zLayer=> { cy.get('[role="slider"]')
zLayer = Number($zLayer); .should('have.attr', 'aria-valuenow')
}); .then(($zLayer) => {
cy.get('i[aria-label="icon: plus-circle"]').click(); zLayer = Number($zLayer);
});
cy.get('span[aria-label="plus-circle"]').click();
cy.get('[role="slider"]').should('have.attr', 'aria-valuenow', zLayer + 1); cy.get('[role="slider"]').should('have.attr', 'aria-valuenow', zLayer + 1);
}); });
}); });
@ -61,22 +62,25 @@ context('Actions on polygon', () => {
cy.get('.cvat-canvas-container').click(); cy.get('.cvat-canvas-container').click();
}); });
it('Second shape is over the first shape', () => { it('Second shape is over the first shape', () => {
// The larger the index of an element in the array the closer it is to us // The larger the index of an element in the array the closer it is to us
cy.get('.cvat_canvas_shape').then($canvasShape => { cy.get('.cvat_canvas_shape').then(($canvasShape) => {
                expect(Number($canvasShape[1].id.match(/\d+$/))).to.be.equal(2); expect(Number($canvasShape[1].id.match(/\d+$/))).to.be.equal(2);
}); });
}); });
it('Activate first shape', () => { it('Activate first shape', () => {
cy.get('#cvat_canvas_shape_1').trigger('mousemove').trigger('mouseover'); cy.get('#cvat_canvas_shape_1').trigger('mousemove').trigger('mouseover');
}); });
it('First shape is over the second shape', () => { it('First shape is over the second shape', () => {
// The larger the index of an element in the array the closer it is to us // The larger the index of an element in the array the closer it is to us
            cy.get('.cvat_canvas_shape').then($canvasShape => { cy.get('.cvat_canvas_shape').then(($canvasShape) => {
                expect(Number($canvasShape[1].id.match(/\d+$/))).to.be.equal(1); expect(Number($canvasShape[1].id.match(/\d+$/))).to.be.equal(1);
assert.isAbove(Number($canvasShape.eq(-1).attr('fill-opacity')), Number($canvasShape.eq(0).attr('fill-opacity'))); assert.isAbove(
Number($canvasShape.eq(-1).attr('fill-opacity')),
Number($canvasShape.eq(0).attr('fill-opacity')),
);
}); });
}); });
@ -97,10 +101,12 @@ context('Actions on polygon', () => {
it('Increase z-layer with a special switcher', () => { it('Increase z-layer with a special switcher', () => {
cy.get('.cvat-canvas-z-axis-wrapper').within(() => { cy.get('.cvat-canvas-z-axis-wrapper').within(() => {
cy.get('[role="slider"]').should('have.attr', 'aria-valuenow').then($zLayer=> { cy.get('[role="slider"]')
zLayer = Number($zLayer); .should('have.attr', 'aria-valuenow')
}); .then(($zLayer) => {
cy.get('i[aria-label="icon: plus-circle"]').click(); zLayer = Number($zLayer);
});
cy.get('span[aria-label="plus-circle"]').click();
cy.get('[role="slider"]').should('have.attr', 'aria-valuenow', zLayer + 2); cy.get('[role="slider"]').should('have.attr', 'aria-valuenow', zLayer + 2);
}); });
}); });

@ -32,7 +32,7 @@ context('Lock/hide features.', () => {
firstX: 260, firstX: 260,
firstY: 200, firstY: 200,
secondX: 360, secondX: 360,
secondY: 250 secondY: 250,
}; };
const createCuboidShape4Points = { const createCuboidShape4Points = {
points: 'By 4 Points', points: 'By 4 Points',
@ -61,9 +61,7 @@ context('Lock/hide features.', () => {
const createPointsShapeSwitchLabel = { const createPointsShapeSwitchLabel = {
type: 'Shape', type: 'Shape',
labelName: newLabelName2, labelName: newLabelName2,
pointsMap: [ pointsMap: [{ x: 700, y: 200 }],
{ x: 700, y: 200 }
],
complete: true, complete: true,
numberOfPoints: null, numberOfPoints: null,
}; };
@ -108,7 +106,7 @@ context('Lock/hide features.', () => {
it('Draw several objects (different shapes, tracks, tags, labels)', () => { it('Draw several objects (different shapes, tracks, tags, labels)', () => {
cy.createPolygon(createPolygonShape); cy.createPolygon(createPolygonShape);
// Get css "background-color" for further comparison. // Get css "background-color" for further comparison.
cy.get('#cvat-objects-sidebar-state-item-1').then($cvatObjectsSidebarStateItem1 => { cy.get('#cvat-objects-sidebar-state-item-1').then(($cvatObjectsSidebarStateItem1) => {
cvatObjectsSidebarStateItem1 = $cvatObjectsSidebarStateItem1.css('background-color'); cvatObjectsSidebarStateItem1 = $cvatObjectsSidebarStateItem1.css('background-color');
}); });
cy.createRectangle(createRectangleTrack2Points); cy.createRectangle(createRectangleTrack2Points);
@ -121,9 +119,9 @@ context('Lock/hide features.', () => {
}); });
it('Lock all the objects with a dedicated button (in side bar header). All the objects are locked.', () => { it('Lock all the objects with a dedicated button (in side bar header). All the objects are locked.', () => {
cy.get('.cvat-objects-sidebar-states-header').within(() => { cy.get('.cvat-objects-sidebar-states-header').within(() => {
cy.get('i[aria-label="icon: unlock"]').click(); cy.get('span[aria-label="unlock"]').click();
}); });
cy.get('.cvat-objects-sidebar-state-item').each(item => { cy.get('.cvat-objects-sidebar-state-item').each((item) => {
cy.get(item).within(() => { cy.get(item).within(() => {
cy.get('.cvat-object-item-button-lock-enabled').should('exist'); cy.get('.cvat-object-item-button-lock-enabled').should('exist');
}); });
@ -131,59 +129,68 @@ context('Lock/hide features.', () => {
}); });
it('Hide all the objects. Objects are still visible because they cannot be hidden while locked.', () => { it('Hide all the objects. Objects are still visible because they cannot be hidden while locked.', () => {
cy.get('.cvat-objects-sidebar-states-header').within(() => { cy.get('.cvat-objects-sidebar-states-header').within(() => {
cy.get('i[aria-label="icon: eye-invisible"]').click(); cy.get('span[aria-label="eye-invisible"]').click();
}); });
cy.get('.cvat-objects-sidebar-state-item').each(item => { cy.get('.cvat-objects-sidebar-state-item').each((item) => {
cy.get(item).within(() => { cy.get(item).within(() => {
cy.get('.cvat-object-item-button-hidden-enabled').should('not.exist'); cy.get('.cvat-object-item-button-hidden-enabled').should('not.exist');
}); });
}); });
cy.get('.cvat_canvas_shape').each(item => { cy.get('.cvat_canvas_shape').each((item) => {
cy.get(item).should('be.visible'); cy.get(item).should('be.visible');
}); });
}); });
it('Unlock all objects and hide all objects. All the objects are hidden.', () => { it('Unlock all objects and hide all objects. All the objects are hidden.', () => {
cy.get('.cvat-objects-sidebar-states-header').within(() => { cy.get('.cvat-objects-sidebar-states-header').within(() => {
cy.get('i[aria-label="icon: lock"]').click(); cy.get('span[aria-label="lock"]').click();
cy.get('i[aria-label="icon: eye"]').click(); cy.get('span[aria-label="eye"]').click();
}); });
cy.get('.cvat-objects-sidebar-state-item').each(item => { cy.get('.cvat-objects-sidebar-state-item').each((item) => {
cy.get(item).invoke('text').then($itemText => { cy.get(item)
// Sidebar for "Tag" doesn't have "Switch hidden property" button. .invoke('text')
if (!$itemText.match(/\d+TAG/)) { .then(($itemText) => {
cy.get(item).within(() => { // Sidebar for "Tag" doesn't have "Switch hidden property" button.
cy.get('.cvat-object-item-button-hidden-enabled').should('exist'); if (!$itemText.match(/\d+TAG/)) {
}); cy.get(item).within(() => {
} cy.get('.cvat-object-item-button-hidden-enabled').should('exist');
}); });
}
});
}); });
cy.get('.cvat_canvas_shape').each(item => { cy.get('.cvat_canvas_shape').each((item) => {
cy.get(item).should('have.class', 'cvat_canvas_hidden'); cy.get(item).should('have.class', 'cvat_canvas_hidden');
}); });
}); });
it('Set properties occluded & pinned to true for a shape. Shape is occluded is visualized (dashed contour) and the shape cannot be moved, but can be resized.', () => { it('Set properties occluded & pinned to true for a shape. Shape is occluded is visualized (dashed contour) and the shape cannot be moved, but can be resized.', () => {
// Unhide rectangle shape. // Unhide rectangle shape.
cy.get('#cvat-objects-sidebar-state-item-6').within(() => { cy.get('#cvat-objects-sidebar-state-item-6').within(() => {
cy.get('i[aria-label="icon: eye-invisible"]').click(); cy.get('span[aria-label="eye-invisible"]').click();
}); });
cy.get('#cvat_canvas_shape_6').should('be.visible'); cy.get('#cvat_canvas_shape_6').should('be.visible');
cy.get('#cvat-objects-sidebar-state-item-6').within(() => { cy.get('#cvat-objects-sidebar-state-item-6').within(() => {
cy.get('.cvat-object-item-button-occluded').click().should('have.class', 'cvat-object-item-button-occluded-enabled'); cy.get('.cvat-object-item-button-occluded').click();
}); });
cy.get('#cvat_canvas_shape_6').should('have.css', 'stroke-dasharray'); cy.get('#cvat_canvas_shape_6').should('have.css', 'stroke-dasharray');
cy.get('#cvat-objects-sidebar-state-item-6').within(() => { cy.get('#cvat-objects-sidebar-state-item-6').within(() => {
cy.get('.cvat-object-item-button-pinned').click().should('have.class', 'cvat-object-item-button-pinned-enabled'); cy.get('.cvat-object-item-button-pinned').click();
}); });
cy.get('#cvat_canvas_shape_6').should('not.have.class', 'cvat_canvas_shape_draggable'); cy.get('#cvat_canvas_shape_6').should('not.have.class', 'cvat_canvas_shape_draggable');
// Get cuttent values for "width" parameter. // Get cuttent values for "width" parameter.
cy.get('#cvat_canvas_shape_6').should('have.attr', 'width').then($shapeWidth => { cy.get('#cvat_canvas_shape_6')
shapeWidth = $shapeWidth; .should('have.attr', 'width')
}); .then(($shapeWidth) => {
shapeWidth = $shapeWidth;
});
// Resize rectangle shape. // Resize rectangle shape.
cy.get('.cvat-canvas-container').trigger('mousedown', 650, 400, {button: 0}).trigger('mousemove', 660, 400).trigger('mouseup'); cy.get('.cvat-canvas-container')
cy.get('#cvat_canvas_shape_6').should('have.attr', 'width').then($shapeWidth => { .trigger('mousedown', 650, 400, { button: 0 })
expect(Math.floor(shapeWidth)).to.be.lessThan(Math.floor($shapeWidth)); // expected 95 to be below 104 .trigger('mousemove', 660, 400)
}); .trigger('mouseup');
cy.get('#cvat_canvas_shape_6')
.should('have.attr', 'width')
.then(($shapeWidth) => {
expect(Math.floor(shapeWidth)).to.be.lessThan(Math.floor($shapeWidth)); // expected 95 to be below 104
});
}); });
it('Go to polygon. Pinned is set to true by default. Set it to false. Polygon can be moved.', () => { it('Go to polygon. Pinned is set to true by default. Set it to false. Polygon can be moved.', () => {
cy.get('#cvat-objects-sidebar-state-item-1').within(() => { cy.get('#cvat-objects-sidebar-state-item-1').within(() => {
@ -191,17 +198,17 @@ context('Lock/hide features.', () => {
}); });
cy.get('#cvat_canvas_shape_1').should('not.have.class', 'cvat_canvas_shape_draggable'); cy.get('#cvat_canvas_shape_1').should('not.have.class', 'cvat_canvas_shape_draggable');
cy.get('#cvat-objects-sidebar-state-item-1').within(() => { cy.get('#cvat-objects-sidebar-state-item-1').within(() => {
cy.get('.cvat-object-item-button-pinned').click().should('not.have.class', 'cvat-object-item-button-pinned-enabled'); cy.get('.cvat-object-item-button-pinned').click();
// Unhide polygon shape. // Unhide polygon shape.
cy.get('.cvat-object-item-button-hidden').click().should('not.have.class', 'cvat-object-item-button-hidden-enabled'); cy.get('.cvat-object-item-button-hidden').click();
}); });
cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_draggable'); cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_draggable');
}); });
it('Go to "Labels" tab.', () => { it('Go to "Labels" tab.', () => {
// Hide and unhide all objects for convenience of next testing. // Hide and unhide all objects for convenience of next testing.
cy.get('.cvat-objects-sidebar-states-header').within(() => { cy.get('.cvat-objects-sidebar-states-header').within(() => {
cy.get('i[aria-label="icon: eye"]').click(); cy.get('span[aria-label="eye"]').click();
cy.get('i[aria-label="icon: eye-invisible"]').click(); cy.get('span[aria-label="eye-invisible"]').click();
}); });
cy.get('.cvat-objects-sidebar').within(() => { cy.get('.cvat-objects-sidebar').within(() => {
cy.contains('Labels').click(); cy.contains('Labels').click();
@ -211,13 +218,15 @@ context('Lock/hide features.', () => {
const objectsSameLabel = ['cvat_canvas_shape_1', 'cvat_canvas_shape_2', 'cvat_canvas_shape_3']; const objectsSameLabel = ['cvat_canvas_shape_1', 'cvat_canvas_shape_2', 'cvat_canvas_shape_3'];
cy.get('.cvat-objects-sidebar-labels-list').within(() => { cy.get('.cvat-objects-sidebar-labels-list').within(() => {
// Hide and lock all object with "Main task" label (#cvat_canvas_shape_1-3). // Hide and lock all object with "Main task" label (#cvat_canvas_shape_1-3).
cy.contains(labelName).parents('.cvat-objects-sidebar-label-item').within(() => { cy.contains(labelName)
cy.get('.cvat-label-item-button-hidden').click().should('have.class', 'cvat-label-item-button-hidden-enabled'); .parents('.cvat-objects-sidebar-label-item')
cy.get('.cvat-label-item-button-lock').click().should('have.class', 'cvat-label-item-button-lock-enabled'); .within(() => {
}); cy.get('.cvat-label-item-button-hidden').click();
cy.get('.cvat-label-item-button-lock').click();
});
}); });
cy.get('.cvat_canvas_shape').then(objectList => { cy.get('.cvat_canvas_shape').then((objectList) => {
for (let i=0; i<objectList.length; i++) { for (let i = 0; i < objectList.length; i++) {
// Checking whether the class exists on all objects except for objects with the "Main task" label. // Checking whether the class exists on all objects except for objects with the "Main task" label.
if (!objectsSameLabel.includes(objectList[i].id)) { if (!objectsSameLabel.includes(objectList[i].id)) {
cy.get(objectList[i]).should('not.have.class', 'cvat_canvas_hidden'); cy.get(objectList[i]).should('not.have.class', 'cvat_canvas_hidden');
@ -229,15 +238,19 @@ context('Lock/hide features.', () => {
cy.contains('Objects').click(); cy.contains('Objects').click();
}); });
// Objects that have a label different from the "Main task" should not be blocked. // Objects that have a label different from the "Main task" should not be blocked.
cy.get('.cvat-objects-sidebar-state-item').then(objectSidebarList => { cy.get('.cvat-objects-sidebar-state-item').then((objectSidebarList) => {
for (let i=0; i<objectSidebarList.length; i++) { for (let i = 0; i < objectSidebarList.length; i++) {
if (!objectSidebarList[i].textContent.match(new RegExp(`${labelName}`, 'g'))) { if (!objectSidebarList[i].textContent.match(new RegExp(`${labelName}`, 'g'))) {
cy.get(objectSidebarList[i]).within(() => { cy.get(objectSidebarList[i]).within(() => {
cy.get('.ant-select-selection-selected-value').click({force: true}); cy.get('.ant-select-selection-item').click({ force: true });
}); });
cy.get('.ant-select-dropdown-menu').last().contains(labelName).click({force: true}); cy.get('.ant-select-dropdown').last().contains(labelName).click({ force: true });
// Checking that the css parameter "background-color" has become the same as the ".cvat-objects-sidebar-state-item" with "Main task" label. // Checking that the css parameter "background-color" has become the same as the ".cvat-objects-sidebar-state-item" with "Main task" label.
cy.get(objectSidebarList[i]).should('have.css', 'background-color', cvatObjectsSidebarStateItem1); cy.get(objectSidebarList[i]).should(
'have.css',
'background-color',
cvatObjectsSidebarStateItem1,
);
} }
} }
}); });

@ -32,8 +32,9 @@ context('Canvas grid feature', () => {
cy.get('.cvat-player-settings-grid-color-input').click(); cy.get('.cvat-player-settings-grid-color-input').click();
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${gridColor}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${gridColor}"]`).click();
});
}); });
it('Set "Grid opacity" to 49%.', () => { it('Set "Grid opacity" to 49%.', () => {
cy.get('.cvat-player-settings-grid-opacity-input') cy.get('.cvat-player-settings-grid-opacity-input')

@ -38,8 +38,8 @@ context('Check if the new label reflects in the options', () => {
cy.createRectangle(createRectangleShape2Points); cy.createRectangle(createRectangleShape2Points);
}); });
it('Checking for the new label', () => { it('Checking for the new label', () => {
cy.get('#cvat-objects-sidebar-state-item-1').find('.ant-select-selection').click(); cy.get('#cvat-objects-sidebar-state-item-1').find('.ant-select-selector').click();
cy.get('.ant-select-dropdown-menu-item').should('contain', newLabelName); cy.get('.ant-select-dropdown').not('.ant-select-dropdown-hidden').should('contain', newLabelName);
}); });
}); });
}); });

@ -37,7 +37,7 @@ context('Message in UI when raw labels are wrong.', () => {
describe(`Testing issue "${issueId}"`, () => { describe(`Testing issue "${issueId}"`, () => {
it('"Raw" field is empty.', () => { it('"Raw" field is empty.', () => {
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -49,7 +49,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawNameNumber[0].name = 1; taskRawNameNumber[0].name = 1;
let jsonNameNumber = JSON.stringify(taskRawNameNumber); let jsonNameNumber = JSON.stringify(taskRawNameNumber);
cy.get('#labels').type(jsonNameNumber, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonNameNumber, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -61,7 +61,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawLabelString[0].id = '1'; taskRawLabelString[0].id = '1';
let jsonLabelString = JSON.stringify(taskRawLabelString); let jsonLabelString = JSON.stringify(taskRawLabelString);
cy.get('#labels').type(jsonLabelString, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonLabelString, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -73,7 +73,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawAttrNumber[0].attributes = 1; taskRawAttrNumber[0].attributes = 1;
let jsonAttrNumber = JSON.stringify(taskRawAttrNumber); let jsonAttrNumber = JSON.stringify(taskRawAttrNumber);
cy.get('#labels').type(jsonAttrNumber, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonAttrNumber, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -85,7 +85,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawColorNumber[0].color = 1; taskRawColorNumber[0].color = 1;
let jsonColorNumber = JSON.stringify(taskRawColorNumber); let jsonColorNumber = JSON.stringify(taskRawColorNumber);
cy.get('#labels').type(jsonColorNumber, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonColorNumber, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -97,7 +97,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawAttrIdString[0].attributes[0].id = '1'; taskRawAttrIdString[0].attributes[0].id = '1';
let jsonAttrIdString = JSON.stringify(taskRawAttrIdString); let jsonAttrIdString = JSON.stringify(taskRawAttrIdString);
cy.get('#labels').type(jsonAttrIdString, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonAttrIdString, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -111,7 +111,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawAttrTypeNumber[0].attributes[0].input_type = type; taskRawAttrTypeNumber[0].attributes[0].input_type = type;
let jsonAttrTypeNumber = JSON.stringify(taskRawAttrTypeNumber); let jsonAttrTypeNumber = JSON.stringify(taskRawAttrTypeNumber);
cy.get('#labels').type(jsonAttrTypeNumber, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonAttrTypeNumber, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -125,7 +125,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawAttrMutableNumber[0].attributes[0].mutable = 1; taskRawAttrMutableNumber[0].attributes[0].mutable = 1;
let jsonAttrMutableNumber = JSON.stringify(taskRawAttrMutableNumber); let jsonAttrMutableNumber = JSON.stringify(taskRawAttrMutableNumber);
cy.get('#labels').type(jsonAttrMutableNumber, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonAttrMutableNumber, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -137,7 +137,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawAttrValuesNumber[0].attributes[0].values = 1; taskRawAttrValuesNumber[0].attributes[0].values = 1;
let jsonAttrValueNumber = JSON.stringify(taskRawAttrValuesNumber); let jsonAttrValueNumber = JSON.stringify(taskRawAttrValuesNumber);
cy.get('#labels').type(jsonAttrValueNumber, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonAttrValueNumber, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -149,7 +149,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawAttrValuesNumberArr[0].attributes[0].values = [1]; taskRawAttrValuesNumberArr[0].attributes[0].values = [1];
let jsonAttrValuesNumberArr = JSON.stringify(taskRawAttrValuesNumberArr); let jsonAttrValuesNumberArr = JSON.stringify(taskRawAttrValuesNumberArr);
cy.get('#labels').type(jsonAttrValuesNumberArr, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonAttrValuesNumberArr, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -161,7 +161,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawAttrNameNumber[0].attributes[0].name = 1; taskRawAttrNameNumber[0].attributes[0].name = 1;
let jsonAttrNameNumber = JSON.stringify(taskRawAttrNameNumber); let jsonAttrNameNumber = JSON.stringify(taskRawAttrNameNumber);
cy.get('#labels').type(jsonAttrNameNumber, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonAttrNameNumber, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {
@ -173,7 +173,7 @@ context('Message in UI when raw labels are wrong.', () => {
taskRawAttrValuesEmptyArr[0].attributes[0].values = []; taskRawAttrValuesEmptyArr[0].attributes[0].values = [];
let jsonAttrValuesEmptyArr = JSON.stringify(taskRawAttrValuesEmptyArr); let jsonAttrValuesEmptyArr = JSON.stringify(taskRawAttrValuesEmptyArr);
cy.get('#labels').type(jsonAttrValuesEmptyArr, { parseSpecialCharSequences: false }); cy.get('#labels').type(jsonAttrValuesEmptyArr, { parseSpecialCharSequences: false });
cy.get('.ant-form-explain') cy.get('.ant-form-item-explain')
.should('exist') .should('exist')
.invoke('text') .invoke('text')
.then(($explainText) => { .then(($explainText) => {

@ -43,9 +43,9 @@ context('Dump annotation if cuboid created', () => {
cy.get('.cvat-menu-dump-submenu-item').within(() => { cy.get('.cvat-menu-dump-submenu-item').within(() => {
cy.contains('Datumaro').click(); cy.contains('Datumaro').click();
}); });
cy.wait(3000);
}); });
it('Error notification is ot exists', () => { it('Error notification is not exists', () => {
cy.wait(5000);
cy.get('.ant-notification-notice').should('not.exist'); cy.get('.ant-notification-notice').should('not.exist');
}); });
}); });

@ -58,7 +58,7 @@ context('An error occurs in AAM when switching to 2 frames, if the frames have o
.click({ force: true }); .click({ force: true });
}); });
it('Page with the error is missing', () => { it('Page with the error is missing', () => {
cy.contains('Oops, something went wrong').should('not.exist'); cy.contains('Oops, something went wrong', { timeout: 1000 }).should('not.exist');
cy.changeLabelAAM(labelName); cy.changeLabelAAM(labelName);
cy.get('.attribute-annotation-sidebar-object-switcher').should('contain', `${labelName} 2 [2/2]`); cy.get('.attribute-annotation-sidebar-object-switcher').should('contain', `${labelName} 2 [2/2]`);
}); });

@ -8,47 +8,29 @@ context('Wrong attribute is removed in label constructor.', () => {
const issueId = '2411'; const issueId = '2411';
const taskRaw = [ const taskRaw = [
{ {
name: "person", name: 'person',
color: "#ff6037", color: '#ff6037',
attributes: [ attributes: [
{ {
name: "lower_body", name: 'lower_body',
input_type: "select", input_type: 'select',
mutable: true, mutable: true,
values: [ values: ['__undefined__', 'long', 'short', 'n/a'],
"__undefined__", },
"long", {
"short", name: 'hair_color',
"n/a" input_type: 'select',
] mutable: true,
}, values: ['__undefined__', 'black', 'brown', 'blond', 'grey', 'other', 'n/a'],
{ },
name: "hair_color", {
input_type: "select", name: 'cellphone',
mutable: true, input_type: 'select',
values: [ mutable: true,
"__undefined__", values: ['__undefined__', 'yes', 'no', 'n/a'],
"black", },
"brown", ],
"blond", },
"grey",
"other",
"n/a"
]
},
{
name: "cellphone",
input_type: "select",
mutable: true,
values: [
"__undefined__",
"yes",
"no",
"n/a"
]
}
]
}
]; ];
before(() => { before(() => {
@ -67,43 +49,65 @@ context('Wrong attribute is removed in label constructor.', () => {
}); });
it('Go to constructor tab. The label "person" appeared there.', () => { it('Go to constructor tab. The label "person" appeared there.', () => {
cy.get('[role="tab"]').contains('Constructor').click(); cy.get('[role="tab"]').contains('Constructor').click();
cy.get('.cvat-constructor-viewer-item').should('have.text', 'person').within(() => { cy.get('.cvat-constructor-viewer-item')
cy.get('i[aria-label="icon: edit"]').click(); .should('have.text', 'person')
}); .within(() => {
cy.get('span[aria-label="edit"]').click();
});
}); });
it('Remove the average attribute "hair_color". It has been deleted.', () => { it('Remove the average attribute "hair_color". It has been deleted.', () => {
cy.get('.cvat-label-constructor-updater').within(() => { cy.get('.cvat-label-constructor-updater').within(() => {
cy.get('.ant-row-flex-space-between').eq(1).within(() => { cy.get('.cvat-attribute-inputs-wrapper')
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => { .eq(1)
expect(placeholderNameValue).to.be.equal('hair_color'); .within(() => {
cy.get('.cvat-attribute-name-input')
.invoke('val')
.then((placeholderNameValue) => {
expect(placeholderNameValue).to.be.equal('hair_color');
});
cy.get('.cvat-delete-attribute-button').click();
}); });
cy.get('.cvat-delete-attribute-button').click(); cy.get('.cvat-attribute-inputs-wrapper')
}); .eq(0)
cy.get('.ant-row-flex-space-between').eq(0).within(() => { .within(() => {
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => { cy.get('.cvat-attribute-name-input')
expect(placeholderNameValue).to.be.equal('cellphone'); .invoke('val')
.then((placeholderNameValue) => {
expect(placeholderNameValue).to.be.equal('lower_body');
});
}); });
}); cy.get('.cvat-attribute-inputs-wrapper')
cy.get('.ant-row-flex-space-between').eq(1).within(() => { .eq(1)
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => { .within(() => {
expect(placeholderNameValue).to.be.equal('lower_body'); cy.get('.cvat-attribute-name-input')
.invoke('val')
.then((placeholderNameValue) => {
expect(placeholderNameValue).to.be.equal('cellphone');
});
}); });
});
}); });
}); });
it('Remove the latest attribute "lower_body". It has been deleted.', () => { it('Remove the latest attribute "lower_body". It has been deleted.', () => {
cy.get('.cvat-label-constructor-updater').within(() => { cy.get('.cvat-label-constructor-updater').within(() => {
cy.get('.ant-row-flex-space-between').eq(1).within(() => { cy.get('.cvat-attribute-inputs-wrapper')
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => { .eq(1)
expect(placeholderNameValue).to.be.equal('lower_body'); .within(() => {
cy.get('.cvat-attribute-name-input')
.invoke('val')
.then((placeholderNameValue) => {
expect(placeholderNameValue).to.be.equal('cellphone');
});
cy.get('.cvat-delete-attribute-button').click();
}); });
cy.get('.cvat-delete-attribute-button').click(); cy.get('.cvat-attribute-inputs-wrapper')
}); .eq(0)
cy.get('.ant-row-flex-space-between').eq(0).within(() => { .within(() => {
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => { cy.get('.cvat-attribute-name-input')
expect(placeholderNameValue).to.be.equal('cellphone'); .invoke('val')
.then((placeholderNameValue) => {
expect(placeholderNameValue).to.be.equal('lower_body');
});
}); });
});
}); });
}); });
}); });

@ -37,9 +37,7 @@ context('Check hide/unhide functionality from label tab for object and tag with
cy.contains(labelName) cy.contains(labelName)
.parents('.cvat-objects-sidebar-label-item') .parents('.cvat-objects-sidebar-label-item')
.within(() => { .within(() => {
cy.get('.cvat-label-item-button-hidden') cy.get('.cvat-label-item-button-hidden').click();
.click()
.should('have.class', 'cvat-label-item-button-hidden-enabled');
}); });
}); });
cy.get('#cvat_canvas_shape_1').should('be.hidden'); cy.get('#cvat_canvas_shape_1').should('be.hidden');
@ -49,9 +47,7 @@ context('Check hide/unhide functionality from label tab for object and tag with
cy.contains(labelName) cy.contains(labelName)
.parents('.cvat-objects-sidebar-label-item') .parents('.cvat-objects-sidebar-label-item')
.within(() => { .within(() => {
cy.get('.cvat-label-item-button-hidden') cy.get('.cvat-label-item-button-hidden').click();
.click()
.should('not.have.class', 'cvat-label-item-button-hidden-enabled');
}); });
}); });
cy.get('#cvat_canvas_shape_1').should('be.visible'); cy.get('#cvat_canvas_shape_1').should('be.visible');

@ -20,8 +20,9 @@ context('Value must be a user instance.', () => {
}); });
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${Cypress.env('user')}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${Cypress.env('user')}"]`).click();
});
cy.get('.cvat-spinner').should('exist'); cy.get('.cvat-spinner').should('exist');
}); });
it('Assign the task to the same user again', () => { it('Assign the task to the same user again', () => {
@ -30,8 +31,9 @@ context('Value must be a user instance.', () => {
}); });
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${Cypress.env('user')}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${Cypress.env('user')}"]`).click();
});
// Before fix: // Before fix:
// The following error originated from your application code, not from Cypress. // The following error originated from your application code, not from Cypress.
// > Value must be a user instance // > Value must be a user instance

@ -27,6 +27,6 @@ describe('Check server availability', () => {
it('Click to "Sign in" button', () => { it('Click to "Sign in" button', () => {
cy.get('[type="submit"]').click(); cy.get('[type="submit"]').click();
cy.wait(10000); cy.wait(1000);
}); });
}); });

@ -60,8 +60,8 @@ Cypress.Commands.add(
cy.get('[placeholder="Label name"]').type(labelName); cy.get('[placeholder="Label name"]').type(labelName);
cy.get('.cvat-new-attribute-button').click(); cy.get('.cvat-new-attribute-button').click();
cy.get('[placeholder="Name"]').type(attrName); cy.get('[placeholder="Name"]').type(attrName);
cy.get('div[title="Select"]').click(); cy.get('.cvat-attribute-type-input').click();
cy.get('li').contains('Text').click(); cy.get('.ant-select-item-option').contains('Text').click();
cy.get('[placeholder="Default value"]').type(textDefaultValue); cy.get('[placeholder="Default value"]').type(textDefaultValue);
if (multiAttrParams) { if (multiAttrParams) {
cy.updateAttributes(multiAttrParams); cy.updateAttributes(multiAttrParams);
@ -72,8 +72,9 @@ Cypress.Commands.add(
cy.get('.cvat-project-search-field').click(); cy.get('.cvat-project-search-field').click();
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${projectName}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${projectName}"]`).click();
});
} }
cy.get('.cvat-project-search-field').within(() => { cy.get('.cvat-project-search-field').within(() => {
cy.get('[type="text"]').should('have.value', projectName); cy.get('[type="text"]').should('have.value', projectName);
@ -130,7 +131,7 @@ Cypress.Commands.add('createRectangle', (createRectangleParams) => {
cy.contains('Draw new rectangle') cy.contains('Draw new rectangle')
.parents('.cvat-draw-shape-popover-content') .parents('.cvat-draw-shape-popover-content')
.within(() => { .within(() => {
cy.get('.ant-select-selection-selected-value').then(($labelValue) => { cy.get('.ant-select-selection-item').then(($labelValue) => {
selectedValueGlobal = $labelValue.text(); selectedValueGlobal = $labelValue.text();
}); });
cy.get('.ant-radio-wrapper').contains(createRectangleParams.points).click(); cy.get('.ant-radio-wrapper').contains(createRectangleParams.points).click();
@ -151,12 +152,13 @@ Cypress.Commands.add('switchLabel', (labelName, objectType) => {
cy.contains(regex) cy.contains(regex)
.parents('.cvat-draw-shape-popover-content') .parents('.cvat-draw-shape-popover-content')
.within(() => { .within(() => {
cy.get('.ant-select-selection-selected-value').click(); cy.get('.ant-select-selection-item').click();
}); });
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${labelName}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${labelName}"]`).click();
});
}); });
Cypress.Commands.add('checkObjectParameters', (objectParameters, objectType) => { Cypress.Commands.add('checkObjectParameters', (objectParameters, objectType) => {
@ -172,7 +174,7 @@ Cypress.Commands.add('checkObjectParameters', (objectParameters, objectType) =>
.should('contain', maxId) .should('contain', maxId)
.and('contain', `${objectType} ${objectParameters.type.toUpperCase()}`) .and('contain', `${objectType} ${objectParameters.type.toUpperCase()}`)
.within(() => { .within(() => {
cy.get('.ant-select-selection-selected-value').should('have.text', selectedValueGlobal); cy.get('.ant-select-selection-item').should('have.text', selectedValueGlobal);
}); });
}); });
}); });
@ -183,7 +185,7 @@ Cypress.Commands.add('createPoint', (createPointParams) => {
cy.contains('Draw new points') cy.contains('Draw new points')
.parents('.cvat-draw-shape-popover-content') .parents('.cvat-draw-shape-popover-content')
.within(() => { .within(() => {
cy.get('.ant-select-selection-selected-value').then(($labelValue) => { cy.get('.ant-select-selection-item').then(($labelValue) => {
selectedValueGlobal = $labelValue.text(); selectedValueGlobal = $labelValue.text();
}); });
if (createPointParams.numberOfPoints) { if (createPointParams.numberOfPoints) {
@ -225,7 +227,7 @@ Cypress.Commands.add('createPolygon', (createPolygonParams) => {
cy.contains('Draw new polygon') cy.contains('Draw new polygon')
.parents('.cvat-draw-shape-popover-content') .parents('.cvat-draw-shape-popover-content')
.within(() => { .within(() => {
cy.get('.ant-select-selection-selected-value').then(($labelValue) => { cy.get('.ant-select-selection-item').then(($labelValue) => {
selectedValueGlobal = $labelValue.text(); selectedValueGlobal = $labelValue.text();
}); });
if (createPolygonParams.numberOfPoints) { if (createPolygonParams.numberOfPoints) {
@ -259,7 +261,10 @@ Cypress.Commands.add('closeSettings', () => {
Cypress.Commands.add('changeWorkspace', (mode, labelName) => { Cypress.Commands.add('changeWorkspace', (mode, labelName) => {
cy.get('.cvat-workspace-selector').click(); cy.get('.cvat-workspace-selector').click();
cy.get('.ant-select-dropdown-menu-item').contains(mode).click(); cy.get('.cvat-workspace-selector-dropdown').within(() => {
cy.get(`.ant-select-item-option[title="${mode}"]`).click();
});
cy.get('.cvat-workspace-selector').should('contain.text', mode); cy.get('.cvat-workspace-selector').should('contain.text', mode);
cy.changeLabelAAM(labelName); cy.changeLabelAAM(labelName);
}); });
@ -269,12 +274,13 @@ Cypress.Commands.add('changeLabelAAM', (labelName) => {
const cvatWorkspaceSelectorValue = value.text(); const cvatWorkspaceSelectorValue = value.text();
if (cvatWorkspaceSelectorValue === 'Attribute annotation') { if (cvatWorkspaceSelectorValue === 'Attribute annotation') {
cy.get('.attribute-annotation-sidebar-basics-editor').within(() => { cy.get('.attribute-annotation-sidebar-basics-editor').within(() => {
cy.get('.ant-select-selection').click(); cy.get('.ant-select-selector').click();
}); });
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${labelName}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${labelName}"]`).click();
});
} }
}); });
}); });
@ -285,7 +291,7 @@ Cypress.Commands.add('createCuboid', (createCuboidParams) => {
cy.contains('Draw new cuboid') cy.contains('Draw new cuboid')
.parents('.cvat-draw-shape-popover-content') .parents('.cvat-draw-shape-popover-content')
.within(() => { .within(() => {
cy.get('.ant-select-selection-selected-value').then(($labelValue) => { cy.get('.ant-select-selection-item').then(($labelValue) => {
selectedValueGlobal = $labelValue.text(); selectedValueGlobal = $labelValue.text();
}); });
cy.contains(createCuboidParams.points).click(); cy.contains(createCuboidParams.points).click();
@ -317,8 +323,9 @@ Cypress.Commands.add('updateAttributes', (multiAttrParams) => {
}); });
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${multiAttrParams.typeAttribute}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${multiAttrParams.typeAttribute}"]`).click();
});
if (multiAttrParams.typeAttribute === 'Text' || multiAttrParams.typeAttribute === 'Number') { if (multiAttrParams.typeAttribute === 'Text' || multiAttrParams.typeAttribute === 'Number') {
cy.get(`[cvat-attribute-id="${minId}"]`).within(() => { cy.get(`[cvat-attribute-id="${minId}"]`).within(() => {
@ -334,8 +341,9 @@ Cypress.Commands.add('updateAttributes', (multiAttrParams) => {
}); });
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^.*${multiAttrParams.additionalValue}.*$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${multiAttrParams.additionalValue}"]`).click();
});
} }
}); });
}); });
@ -346,7 +354,7 @@ Cypress.Commands.add('createPolyline', (createPolylineParams) => {
cy.contains('Draw new polyline') cy.contains('Draw new polyline')
.parents('.cvat-draw-shape-popover-content') .parents('.cvat-draw-shape-popover-content')
.within(() => { .within(() => {
cy.get('.ant-select-selection-selected-value').then(($labelValue) => { cy.get('.ant-select-selection-item').then(($labelValue) => {
selectedValueGlobal = $labelValue.text(); selectedValueGlobal = $labelValue.text();
}); });
if (createPolylineParams.numberOfPoints) { if (createPolylineParams.numberOfPoints) {
@ -407,7 +415,7 @@ Cypress.Commands.add('removeAnnotations', () => {
cy.contains('Remove annotations').click(); cy.contains('Remove annotations').click();
}); });
cy.get('.ant-modal-content').within(() => { cy.get('.ant-modal-content').within(() => {
cy.get('.ant-btn-danger').click(); cy.get('.ant-btn-dangerous').click();
}); });
}); });
@ -449,10 +457,9 @@ Cypress.Commands.add('createTag', (labelName) => {
Cypress.Commands.add('sidebarItemSortBy', (sortBy) => { Cypress.Commands.add('sidebarItemSortBy', (sortBy) => {
cy.get('.cvat-objects-sidebar-ordering-selector').click(); cy.get('.cvat-objects-sidebar-ordering-selector').click();
cy.get('.ant-select-dropdown') cy.get('.cvat-objects-sidebar-ordering-dropdown').within(() => {
.not('.ant-select-dropdown-hidden') cy.get(`.ant-select-item-option[title="${sortBy}"]`).click();
.contains(new RegExp(`^${sortBy}$`, 'g')) });
.click();
}); });
Cypress.Commands.add('goToRegisterPage', () => { Cypress.Commands.add('goToRegisterPage', () => {
@ -466,8 +473,9 @@ Cypress.Commands.add('assignTaskToUser', (user) => {
}); });
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${user}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${user}"]`).click();
});
}); });
Cypress.Commands.add('getScaleValue', () => { Cypress.Commands.add('getScaleValue', () => {
@ -481,13 +489,13 @@ Cypress.Commands.add('getScaleValue', () => {
Cypress.Commands.add('writeFilterValue', (clear, filterValue) => { Cypress.Commands.add('writeFilterValue', (clear, filterValue) => {
if (clear) { if (clear) {
cy.get('.cvat-annotations-filters-input').within(() => { cy.get('.cvat-annotations-filters-input').within(() => {
cy.get('.ant-select-selection__choice__remove').click(); cy.get('.ant-select-selection-item-remove').click();
}); });
} }
cy.get('.cvat-annotations-filters-input') cy.get('.cvat-annotations-filters-input')
.type(`${filterValue}{Enter}`) .type(`${filterValue}{Enter}`)
.within(() => { .within(() => {
cy.get('.ant-select-selection__choice__content').should('have.text', filterValue); cy.get('.ant-select-selection-item-content').should('have.text', filterValue);
}); });
}); });

@ -16,8 +16,8 @@ Cypress.Commands.add('createProjects', (projectName, labelName, attrName, textDe
cy.get('[placeholder="Label name"]').type(labelName); cy.get('[placeholder="Label name"]').type(labelName);
cy.get('.cvat-new-attribute-button').click(); cy.get('.cvat-new-attribute-button').click();
cy.get('[placeholder="Name"]').type(attrName); cy.get('[placeholder="Name"]').type(attrName);
cy.get('div[title="Select"]').click(); cy.get('.cvat-attribute-type-input').click();
cy.get('li').contains('Text').click(); cy.get('.ant-select-item-option').contains('Text').click();
cy.get('[placeholder="Default value"]').type(textDefaultValue); cy.get('[placeholder="Default value"]').type(textDefaultValue);
if (multiAttrParams) { if (multiAttrParams) {
cy.updateAttributes(multiAttrParams); cy.updateAttributes(multiAttrParams);
@ -70,6 +70,7 @@ Cypress.Commands.add('assignProjectToUser', (user) => {
}); });
cy.get('.ant-select-dropdown') cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden') .not('.ant-select-dropdown-hidden')
.contains(new RegExp(`^${user}$`, 'g')) .within(() => {
.click(); cy.get(`.ant-select-item-option[title="${user}"]`).click();
});
}); });

Loading…
Cancel
Save