diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/handle-popover-visibility.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/handle-popover-visibility.tsx index f854b359050b..d0c47c96a0e0 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/handle-popover-visibility.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/handle-popover-visibility.tsx @@ -4,7 +4,6 @@ import React, { useState } from 'react'; import Popover, { PopoverProps } from 'antd/lib/popover'; -import waitFor from 'utils/wait-for'; export default function withVisibilityHandling(WrappedComponent: typeof Popover, popoverType: string) { return (props: PopoverProps): JSX.Element => { @@ -12,32 +11,29 @@ export default function withVisibilityHandling(WrappedComponent: typeof Popover, const { overlayClassName, ...rest } = props; const overlayClassNames = typeof overlayClassName === 'string' ? overlayClassName.split(/\s+/) : []; const popoverClassName = `cvat-${popoverType}-popover`; - const visiblePopoverClassName = `cvat-${popoverType}-popover-visible`; overlayClassNames.push(popoverClassName); - if (visible) { - overlayClassNames.push(visiblePopoverClassName); - } + const { overlayStyle } = props; return ( { - const [element] = window.document.getElementsByClassName(popoverClassName); - if (element) { - if (_visible) { + if (_visible) { + const [element] = window.document.getElementsByClassName(popoverClassName); + if (element) { element.dispatchEvent(new MouseEvent('mousedown', { bubbles: true })); - waitFor(60, () => { - const style = window.getComputedStyle(element); - return style.display !== 'none' && style.pointerEvents !== 'none'; - }).then(() => { - setVisible(_visible); - }); - } else { - setVisible(_visible); + (element as HTMLElement).style.pointerEvents = ''; + (element as HTMLElement).style.opacity = ''; } } + setVisible(_visible); }} /> ); diff --git a/tests/cypress/integration/actions_objects/case_60_autoborder_feature.js b/tests/cypress/integration/actions_objects/case_60_autoborder_feature.js index 4e232e1fe684..60e50c8dbc6d 100644 --- a/tests/cypress/integration/actions_objects/case_60_autoborder_feature.js +++ b/tests/cypress/integration/actions_objects/case_60_autoborder_feature.js @@ -77,7 +77,7 @@ context('Autoborder feature.', () => { testCollectCxCircleCoord(rectangleSvgJsCircleIdSecond); cy.interactControlButton('draw-polygon'); - cy.get('.cvat-draw-polygon-popover-visible').find('[type="button"]').contains('Shape').click(); + cy.get('.cvat-draw-polygon-popover').find('[type="button"]').contains('Shape').click(); cy.get('body').type('{Ctrl}'); // Autoborder activation testAutoborderPointsCount(8); // 8 points at the rectangles cy.get('.cvat-canvas-container').click(400, 350).click(450, 250).click(500, 350).click(500, 450); @@ -91,7 +91,7 @@ context('Autoborder feature.', () => { it('Start drawing a polyline with autobordering between the two shapes.', () => { cy.interactControlButton('draw-polyline'); - cy.get('.cvat-draw-polyline-popover-visible').find('[type="button"]').contains('Shape').click(); + cy.get('.cvat-draw-polyline-popover').find('[type="button"]').contains('Shape').click(); testAutoborderPointsCount(12); // 8 points at the rectangles + 4 at the polygon cy.get('.cvat-canvas-container') // Drawning .click(600, 350) diff --git a/tests/cypress/integration/actions_objects2/case_14_appearance_features.js b/tests/cypress/integration/actions_objects2/case_14_appearance_features.js index 4da966d3c761..d864712c69bd 100644 --- a/tests/cypress/integration/actions_objects2/case_14_appearance_features.js +++ b/tests/cypress/integration/actions_objects2/case_14_appearance_features.js @@ -169,9 +169,17 @@ context('Appearance features', () => { }); it('"Selected opacity" slider now defines opacity level of shapes being drawn.', () => { - function testDrawShapeCheckOpacity({ shape, drawingMethod, shapeType, fillOpacityBefore, fillOpacityAfter, opacityBefore, opacityAfter }) { + function testDrawShapeCheckOpacity({ + shape, + drawingMethod, + shapeType, + fillOpacityBefore, + fillOpacityAfter, + opacityBefore, + opacityAfter, + }) { cy.interactControlButton(`draw-${shape}`); - cy.get(`.cvat-draw-${shape}-popover-visible`).within(() => { + cy.get(`.cvat-draw-${shape}-popover`).within(() => { if (drawingMethod) { cy.contains('.ant-radio-wrapper', drawingMethod).click(); } diff --git a/tests/cypress/integration/actions_tasks/case_72_hotkeys_change_labels.js b/tests/cypress/integration/actions_tasks/case_72_hotkeys_change_labels.js index a75537e8be6d..1a295fcb6aff 100644 --- a/tests/cypress/integration/actions_tasks/case_72_hotkeys_change_labels.js +++ b/tests/cypress/integration/actions_tasks/case_72_hotkeys_change_labels.js @@ -21,7 +21,7 @@ context('Hotkeys to change labels feature.', () => { const archivePath = `cypress/fixtures/${archiveName}`; const imagesFolder = `cypress/fixtures/${imageFileName}`; const directoryToArchive = imagesFolder; - const secondLabel = `Case ${caseId} second` + const secondLabel = `Case ${caseId} second`; const additionalAttrsSecondLabel = [ { additionalAttrName: attrName, additionalValue: '0;3;1', typeAttribute: 'Number', mutable: false }, ]; @@ -88,15 +88,19 @@ context('Hotkeys to change labels feature.', () => { // Set settings "Always show object details" to check issue 3083 testCheckingAlwaysShowObjectDetails(true); cy.createPolygon(createPolygonShape); - cy.get('#cvat-objects-sidebar-state-item-1').find('.cvat-objects-sidebar-state-item-label-selector').should('have.text', firstLabelCurrentVal); + cy.get('#cvat-objects-sidebar-state-item-1') + .find('.cvat-objects-sidebar-state-item-label-selector') + .should('have.text', firstLabelCurrentVal); cy.get('.cvat-canvas-container').click(270, 260); cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated'); cy.contains('tspan', `${firstLabelCurrentVal} 1 (manual)`).should('be.visible'); // Check "Attribute keeping when changing label" feature cy.get('#cvat-objects-sidebar-state-item-1').find('.cvat-objects-sidebar-state-item-collapse').click(); - cy.get('body').type('{Ctrl}2') - cy.get('#cvat-objects-sidebar-state-item-1').find('.cvat-objects-sidebar-state-item-label-selector').should('have.text', secondLabelCurrentVal); + cy.get('body').type('{Ctrl}2'); + cy.get('#cvat-objects-sidebar-state-item-1') + .find('.cvat-objects-sidebar-state-item-label-selector') + .should('have.text', secondLabelCurrentVal); cy.contains('tspan', `${secondLabelCurrentVal} 1 (manual)`).should('be.visible'); // The value of the attribute of the 2nd label corresponds to the value of the attribute of the same name of the 1st label cy.get('#cvat-objects-sidebar-state-item-1') @@ -111,13 +115,15 @@ context('Hotkeys to change labels feature.', () => { it('Changing default label before drawing a shape.', () => { cy.interactControlButton('draw-rectangle'); cy.switchLabel(firstLabelCurrentVal, 'draw-rectangle'); - cy.get('.cvat-draw-rectangle-popover-visible').within(() => { + cy.get('.cvat-draw-rectangle-popover').within(() => { cy.contains('button', 'Shape').click(); }); cy.get('body').type('{Ctrl}2'); cy.contains(`Default label was changed to "${secondLabelCurrentVal}"`).should('exist'); cy.get('.cvat-canvas-container').click(500, 500).click(600, 600); - cy.get('#cvat-objects-sidebar-state-item-2').find('.cvat-objects-sidebar-state-item-label-selector').should('have.text', secondLabelCurrentVal); + cy.get('#cvat-objects-sidebar-state-item-2') + .find('.cvat-objects-sidebar-state-item-label-selector') + .should('have.text', secondLabelCurrentVal); }); it('Check changing shortcut for a label.', () => { @@ -126,22 +132,26 @@ context('Hotkeys to change labels feature.', () => { cy.contains('[role="tab"]', 'Labels').click(); }); cy.contains('.cvat-label-item-setup-shortcut-button', '1').click(); - cy.get('.cvat-label-item-setup-shortcut-popover').should('be.visible').within(() => { - cy.get('[type="button"]').then(($btn) => { - expect($btn[0].innerText).to.be.equal(`1:${firstLabelCurrentVal}`); - expect($btn[1].innerText).to.be.equal(`2:${secondLabelCurrentVal}`); - expect($btn[2].innerText).to.be.equal('3:None'); - // Click to "3" button - cy.get($btn[2]).click(); + cy.get('.cvat-label-item-setup-shortcut-popover') + .should('be.visible') + .within(() => { + cy.get('[type="button"]').then(($btn) => { + expect($btn[0].innerText).to.be.equal(`1:${firstLabelCurrentVal}`); + expect($btn[1].innerText).to.be.equal(`2:${secondLabelCurrentVal}`); + expect($btn[2].innerText).to.be.equal('3:None'); + // Click to "3" button + cy.get($btn[2]).click(); + }); }); - }); - cy.get('.cvat-label-item-setup-shortcut-popover').should('be.visible').within(() => { - cy.get('[type="button"]').then(($btn) => { - // Buttons 1 and 3 have changed values - expect($btn[0].innerText).to.be.equal('1:None'); - expect($btn[2].innerText).to.be.equal(`3:${firstLabelCurrentVal}`); + cy.get('.cvat-label-item-setup-shortcut-popover') + .should('be.visible') + .within(() => { + cy.get('[type="button"]').then(($btn) => { + // Buttons 1 and 3 have changed values + expect($btn[0].innerText).to.be.equal('1:None'); + expect($btn[2].innerText).to.be.equal(`3:${firstLabelCurrentVal}`); + }); }); - }); cy.contains('.cvat-label-item-setup-shortcut-button', '3').should('exist'); cy.get('.cvat-canvas-container').click(); // Hide shortcut popover // Go to "Objects" tab @@ -153,7 +163,9 @@ context('Hotkeys to change labels feature.', () => { cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated'); cy.get('body').type('{Ctrl}3'); cy.contains('tspan', `${firstLabelCurrentVal} 1 (manual)`).should('be.visible'); - cy.get('#cvat-objects-sidebar-state-item-1').find('.cvat-objects-sidebar-state-item-label-selector').should('have.text', firstLabelCurrentVal); + cy.get('#cvat-objects-sidebar-state-item-1') + .find('.cvat-objects-sidebar-state-item-label-selector') + .should('have.text', firstLabelCurrentVal); }); }); }); diff --git a/tests/cypress/integration/actions_tasks2/case_101_opencv_basic_actions.js b/tests/cypress/integration/actions_tasks2/case_101_opencv_basic_actions.js index 59d24e16ec7c..503d689a1a26 100644 --- a/tests/cypress/integration/actions_tasks2/case_101_opencv_basic_actions.js +++ b/tests/cypress/integration/actions_tasks2/case_101_opencv_basic_actions.js @@ -9,7 +9,7 @@ import { generateString } from '../../support/utils'; context('OpenCV. Intelligent scissors. Histogram Equalization.', () => { const caseId = '101'; - const newLabel = `Case ${caseId}` + const newLabel = `Case ${caseId}`; const createOpencvShape = { labelName: labelName, pointsMap: [ @@ -49,7 +49,7 @@ context('OpenCV. Intelligent scissors. Histogram Equalization.', () => { describe(`Testing case "${caseId}"`, () => { it('Load OpenCV.', () => { cy.interactOpenCVControlButton(); - cy.get('.cvat-opencv-control-popover-visible').find('.cvat-opencv-initialization-button').click(); + cy.get('.cvat-opencv-control-popover').find('.cvat-opencv-initialization-button').click(); // Intelligent cissors button be visible cy.get('.cvat-opencv-drawing-tool').should('exist').and('be.visible'); }); @@ -78,7 +78,9 @@ context('OpenCV. Intelligent scissors. Histogram Equalization.', () => { // Get count of points againe const intermediateShapeNumberPointsAfterChange = intermediateShape.attr('points').split(' ').length; // expected 7 to be below 10 - expect(intermediateShapeNumberPointsBeforeChange).to.be.lt(intermediateShapeNumberPointsAfterChange); + expect(intermediateShapeNumberPointsBeforeChange).to.be.lt( + intermediateShapeNumberPointsAfterChange, + ); }); }); cy.get('.cvat-appearance-selected-opacity-slider') @@ -86,17 +88,23 @@ context('OpenCV. Intelligent scissors. Histogram Equalization.', () => { .find('[role="slider"]') .then((sliderSelectedOpacityLeft) => { const sliderSelectedOpacityValuenow = sliderSelectedOpacityLeft.attr('aria-valuenow'); - cy.get('.cvat_canvas_interact_intermediate_shape') - .should('have.attr', 'fill-opacity', sliderSelectedOpacityValuenow / 100); - }); + cy.get('.cvat_canvas_interact_intermediate_shape').should( + 'have.attr', + 'fill-opacity', + sliderSelectedOpacityValuenow / 100, + ); + }); cy.get('.cvat-appearance-selected-opacity-slider') .click('right') .find('[role="slider"]') .then((sliderSelectedOpacityRight) => { const sliderSelectedOpacityValuenow = sliderSelectedOpacityRight.attr('aria-valuenow'); - cy.get('.cvat_canvas_interact_intermediate_shape') - .should('have.attr', 'fill-opacity', sliderSelectedOpacityValuenow / 100); - }); + cy.get('.cvat_canvas_interact_intermediate_shape').should( + 'have.attr', + 'fill-opacity', + sliderSelectedOpacityValuenow / 100, + ); + }); cy.get('body').type('{Esc}'); // Cancel drawing cy.get('.cvat_canvas_interact_intermediate_shape').should('not.exist'); cy.get('.cvat_canvas_shape').should('have.length', 2); @@ -114,7 +122,7 @@ context('OpenCV. Intelligent scissors. Histogram Equalization.', () => { // Get count of points const intermediateShapeNumberPoints = intermediateShape.attr('points').split(' ').length; // The last point on the crosshair - expect(intermediateShapeNumberPoints - 1).to.be.equal(pointsMap.length) + expect(intermediateShapeNumberPoints - 1).to.be.equal(pointsMap.length); }); cy.get('body').type('{Ctrl}'); // Checking hotkey cy.get('.cvat_canvas_threshold').should('exist'); @@ -124,7 +132,7 @@ context('OpenCV. Intelligent scissors. Histogram Equalization.', () => { it('Check "Histogram Equalization" feature.', () => { cy.checkPopoverHidden('opencv-control'); cy.interactOpenCVControlButton(); - cy.get('.cvat-opencv-control-popover-visible') + cy.get('.cvat-opencv-control-popover') .contains('[role="tab"]', 'Image') .click() .parents('.ant-tabs-tab') @@ -147,8 +155,7 @@ context('OpenCV. Intelligent scissors. Histogram Equalization.', () => { cy.get('body').trigger('keydown', { keyCode: keyCodeN, shiftKey: true }).trigger('keyup'); cy.get('.cvat-tools-control').should('have.attr', 'tabindex'); createOpencvShape.pointsMap.forEach((el) => { - cy.get('.cvat-canvas-container') - .click(el.x + 150, el.y + 50) + cy.get('.cvat-canvas-container').click(el.x + 150, el.y + 50); }); cy.get('body').trigger('keydown', { keyCode: keyCodeN }).trigger('keyup'); }); diff --git a/tests/cypress/integration/actions_tasks3/case_5_image_rotate.js b/tests/cypress/integration/actions_tasks3/case_5_image_rotate.js index b19c2dd788b6..3681978f79dc 100644 --- a/tests/cypress/integration/actions_tasks3/case_5_image_rotate.js +++ b/tests/cypress/integration/actions_tasks3/case_5_image_rotate.js @@ -17,7 +17,7 @@ context('Check if the image is rotated', () => { cy.get('.cvat-rotate-canvas-controls-left').click(); } cy.get('.cvat-canvas-container').click(); // Hide popover - cy.get('.cvat-rotate-canvas-popover-visible').should('not.exist'); + cy.get('.cvat-rotate-canvas-popover').should('be.hidden'); } function scaleFitImage() { diff --git a/tests/cypress/integration/canvas3d_functionality/case_85_canvas3d_functionality_cuboid_cancel_drawing.js b/tests/cypress/integration/canvas3d_functionality/case_85_canvas3d_functionality_cuboid_cancel_drawing.js index 151c3f451c68..f033967289c5 100644 --- a/tests/cypress/integration/canvas3d_functionality/case_85_canvas3d_functionality_cuboid_cancel_drawing.js +++ b/tests/cypress/integration/canvas3d_functionality/case_85_canvas3d_functionality_cuboid_cancel_drawing.js @@ -20,13 +20,13 @@ context('Canvas 3D functionality. Cancel drawing.', () => { describe(`Testing case "${caseId}"`, () => { it('Cancel drawing.', () => { cy.interactControlButton('draw-cuboid'); - cy.get('.cvat-draw-cuboid-popover-visible').find('.ant-select-selection-item').click(); + cy.get('.cvat-draw-cuboid-popover').find('.ant-select-selection-item').click(); cy.get('.ant-select-dropdown') .not('.ant-select-dropdown-hidden') .within(() => { cy.contains(new RegExp(`^${labelName}$`)).click(); }); - cy.get('.cvat-draw-cuboid-popover-visible').find('button').click(); + cy.get('.cvat-draw-cuboid-popover').find('button').click(); cy.get('.cvat-canvas3d-perspective').trigger('mousemove'); cy.get('.cvat-canvas3d-perspective').screenshot('canvas3d_perspective_drawning'); cy.get('body').type('{Esc}'); diff --git a/tests/cypress/integration/issues_prs/issue_2230_maintenance_popover_visibility.js b/tests/cypress/integration/issues_prs/issue_2230_maintenance_popover_visibility.js index ad7d71edcba5..b8ae242d3143 100644 --- a/tests/cypress/integration/issues_prs/issue_2230_maintenance_popover_visibility.js +++ b/tests/cypress/integration/issues_prs/issue_2230_maintenance_popover_visibility.js @@ -16,13 +16,13 @@ context('Check maintenance of popups visibility.', () => { describe(`Testing issue "${issueId}"`, () => { it('Open a popover for draw an object and apply the "mouseout" event to it. The popover be visible.', () => { cy.interactControlButton('draw-rectangle'); - cy.get('.cvat-draw-rectangle-popover-visible').trigger('mouseout').wait(500); - cy.get('.cvat-draw-rectangle-popover-visible').should('be.visible'); + cy.get('.cvat-draw-rectangle-popover').trigger('mouseout').wait(500); + cy.get('.cvat-draw-rectangle-popover').should('be.visible'); }); it('Click to another element. The popover hidden.', () => { cy.get('.cvat-canvas-container').click(); - cy.get('.cvat-draw-rectangle-popover-visible').should('not.exist'); + cy.get('.cvat-draw-rectangle-popover').should('be.hidden'); }); }); }); diff --git a/tests/cypress/integration/issues_prs/issue_2753_call_HOC_component_each_render.js b/tests/cypress/integration/issues_prs/issue_2753_call_HOC_component_each_render.js index ed1a9564aac9..400b09bad181 100644 --- a/tests/cypress/integration/issues_prs/issue_2753_call_HOC_component_each_render.js +++ b/tests/cypress/integration/issues_prs/issue_2753_call_HOC_component_each_render.js @@ -52,7 +52,7 @@ context('Call HOC component each render.', () => { function checkNumberOfPointsValue(objectType, numberOfPoints) { cy.interactControlButton(`draw-${objectType}`); - cy.get(`.cvat-draw-${objectType}-popover-visible`).within(() => { + cy.get(`.cvat-draw-${objectType}-popover`).within(() => { cy.get('.cvat-draw-shape-popover-points-selector') .find('input') .should('have.attr', 'value', numberOfPoints); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 4fa4db0cf703..3f5dcb52c270 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -241,17 +241,18 @@ Cypress.Commands.add('openTaskJob', (taskName, jobID = 0, removeAnnotations = tr }); Cypress.Commands.add('interactControlButton', (objectType) => { - cy.get('body').focus(); - cy.get(`.cvat-${objectType}-control`).trigger('mouseleave').trigger('mouseout').trigger('mousemove').trigger('mouseover'); - cy.get(`.cvat-${objectType}-popover-visible`).should('exist'); - cy.get(`.cvat-${objectType}-popover-visible`).should('be.visible'); - cy.get(`.cvat-${objectType}-popover-visible`).should('have.attr', 'style').and('not.include', 'pointer-events: none'); + cy.get('body').trigger('mousedown'); + cy.get(`.cvat-${objectType}-control`).trigger('mouseover'); + cy.get(`.cvat-${objectType}-popover`) + .should('be.visible') + .should('have.attr', 'style') + .should('not.include', 'pointer-events: none'); }); Cypress.Commands.add('createRectangle', (createRectangleParams) => { cy.interactControlButton('draw-rectangle'); cy.switchLabel(createRectangleParams.labelName, 'draw-rectangle'); - cy.get('.cvat-draw-rectangle-popover-visible').within(() => { + cy.get('.cvat-draw-rectangle-popover').within(() => { cy.get('.ant-select-selection-item').then(($labelValue) => { selectedValueGlobal = $labelValue.text(); }); @@ -271,9 +272,7 @@ Cypress.Commands.add('createRectangle', (createRectangleParams) => { }); Cypress.Commands.add('switchLabel', (labelName, objectType) => { - cy.get(`.cvat-${objectType}-popover-visible`) - .find('.ant-select-selection-item') - .click(); + cy.get(`.cvat-${objectType}-popover`).find('.ant-select-selection-item').click(); cy.get('.ant-select-dropdown') .not('.ant-select-dropdown-hidden') .find(`.ant-select-item-option[title="${labelName}"]`) @@ -281,9 +280,7 @@ Cypress.Commands.add('switchLabel', (labelName, objectType) => { }); Cypress.Commands.add('checkPopoverHidden', (objectType) => { - cy.get(`.cvat-${objectType}-popover-visible`).should('not.exist'); cy.get(`.cvat-${objectType}-popover`).should('be.hidden'); - cy.get(`.cvat-${objectType}-popover`).should('have.attr', 'style').and('include', 'pointer-events: none'); }); Cypress.Commands.add('checkObjectParameters', (objectParameters, objectType) => { @@ -307,7 +304,7 @@ Cypress.Commands.add('checkObjectParameters', (objectParameters, objectType) => Cypress.Commands.add('createPoint', (createPointParams) => { cy.interactControlButton('draw-points'); cy.switchLabel(createPointParams.labelName, 'draw-points'); - cy.get('.cvat-draw-points-popover-visible').within(() => { + cy.get('.cvat-draw-points-popover').within(() => { cy.get('.ant-select-selection-item').then(($labelValue) => { selectedValueGlobal = $labelValue.text(); }); @@ -322,7 +319,7 @@ Cypress.Commands.add('createPoint', (createPointParams) => { if (createPointParams.finishWithButton) { cy.contains('span', 'Done').click(); } else { - if (! createPointParams.numberOfPoints) { + if (!createPointParams.numberOfPoints) { const keyCodeN = 78; cy.get('.cvat-canvas-container') .trigger('keydown', { keyCode: keyCodeN }) @@ -355,7 +352,7 @@ Cypress.Commands.add('createPolygon', (createPolygonParams) => { if (!createPolygonParams.reDraw) { cy.interactControlButton('draw-polygon'); cy.switchLabel(createPolygonParams.labelName, 'draw-polygon'); - cy.get('.cvat-draw-polygon-popover-visible').within(() => { + cy.get('.cvat-draw-polygon-popover').within(() => { cy.get('.ant-select-selection-item').then(($labelValue) => { selectedValueGlobal = $labelValue.text(); }); @@ -371,7 +368,7 @@ Cypress.Commands.add('createPolygon', (createPolygonParams) => { if (createPolygonParams.finishWithButton) { cy.contains('span', 'Done').click(); } else { - if (! createPolygonParams.numberOfPoints) { + if (!createPolygonParams.numberOfPoints) { const keyCodeN = 78; cy.get('.cvat-canvas-container') .trigger('keydown', { keyCode: keyCodeN }) @@ -429,7 +426,7 @@ Cypress.Commands.add('changeLabelAAM', (labelName) => { Cypress.Commands.add('createCuboid', (createCuboidParams) => { cy.interactControlButton('draw-cuboid'); cy.switchLabel(createCuboidParams.labelName, 'draw-cuboid'); - cy.get('.cvat-draw-cuboid-popover-visible').within(() => { + cy.get('.cvat-draw-cuboid-popover').within(() => { cy.get('.ant-select-selection-item').then(($labelValue) => { selectedValueGlobal = $labelValue.text(); }); @@ -502,7 +499,7 @@ Cypress.Commands.add('updateAttributes', (multiAttrParams) => { Cypress.Commands.add('createPolyline', (createPolylineParams) => { cy.interactControlButton('draw-polyline'); cy.switchLabel(createPolylineParams.labelName, 'draw-polyline'); - cy.get('.cvat-draw-polyline-popover-visible').within(() => { + cy.get('.cvat-draw-polyline-popover').within(() => { cy.get('.ant-select-selection-item').then(($labelValue) => { selectedValueGlobal = $labelValue.text(); }); @@ -517,7 +514,7 @@ Cypress.Commands.add('createPolyline', (createPolylineParams) => { if (createPolylineParams.finishWithButton) { cy.contains('span', 'Done').click(); } else { - if (! createPolylineParams.numberOfPoints) { + if (!createPolylineParams.numberOfPoints) { const keyCodeN = 78; cy.get('.cvat-canvas-container') .trigger('keydown', { keyCode: keyCodeN }) @@ -642,7 +639,7 @@ Cypress.Commands.add('addNewLabelViaContinueButton', (additionalLabels) => { Cypress.Commands.add('createTag', (labelName) => { cy.interactControlButton('setup-tag'); cy.switchLabel(labelName, 'setup-tag'); - cy.get('.cvat-setup-tag-popover-visible').within(() => { + cy.get('.cvat-setup-tag-popover').within(() => { cy.get('button').click(); }); }); @@ -747,5 +744,5 @@ Cypress.Commands.add('exportTask', ({ as, type, format, archiveCustomeName }) => cy.closeNotification('.cvat-notification-notice-export-task-start'); cy.wait(`@${as}`, { timeout: 5000 }).its('response.statusCode').should('equal', 202); cy.wait(`@${as}`).its('response.statusCode').should('equal', 201); - cy.wait(2000) // Waiting for a full file download + cy.wait(2000); // Waiting for a full file download }); diff --git a/tests/cypress/support/commands_canvas3d.js b/tests/cypress/support/commands_canvas3d.js index a3c6197d1dbc..c2d182d3a31f 100644 --- a/tests/cypress/support/commands_canvas3d.js +++ b/tests/cypress/support/commands_canvas3d.js @@ -13,11 +13,10 @@ Cypress.Commands.add('compareImagesAndCheckResult', (baseImage, afterImage, noCh Cypress.Commands.add('create3DCuboid', (cuboidCreationParams) => { cy.interactControlButton('draw-cuboid'); cy.switchLabel(cuboidCreationParams.labelName, 'draw-cuboid'); - cy.get('.cvat-draw-cuboid-popover-visible').find('button').click(); + cy.get('.cvat-draw-cuboid-popover').find('button').click(); cy.get('.cvat-canvas3d-perspective') .trigger('mousemove', cuboidCreationParams.x, cuboidCreationParams.y) .dblclick(cuboidCreationParams.x, cuboidCreationParams.y); cy.wait(1000); // Waiting for a cuboid creation - cy.get('.cvat-draw-cuboid-popover-visible').should('not.exist'); cy.get('.cvat-draw-cuboid-popover').should('be.hidden'); }); diff --git a/tests/cypress/support/commands_opencv.js b/tests/cypress/support/commands_opencv.js index 2851f412469d..1a083028d6d1 100644 --- a/tests/cypress/support/commands_opencv.js +++ b/tests/cypress/support/commands_opencv.js @@ -10,16 +10,17 @@ Cypress.Commands.add('interactOpenCVControlButton', () => { cy.get('body').focus(); cy.get('.cvat-tools-control').trigger('mouseleave').trigger('mouseout').trigger('mousemove').trigger('mouseover'); cy.get('.cvat-tools-control').should('have.class', 'ant-popover-open'); - cy.get('.cvat-opencv-control-popover-visible').should('exist'); - cy.get('.cvat-opencv-control-popover-visible').should('be.visible'); - cy.get('.cvat-opencv-control-popover-visible').should('have.attr', 'style').and('not.include', 'pointer-events'); + cy.get('.cvat-opencv-control-popover') + .should('be.visible') + .should('have.attr', 'style') + .should('not.include', 'pointer-events: none'); }); Cypress.Commands.add('opencvCreateShape', (opencvShapeParams) => { if (!opencvShapeParams.reDraw) { cy.interactOpenCVControlButton(); cy.switchLabel(opencvShapeParams.labelName, 'opencv-control'); - cy.get('.cvat-opencv-control-popover-visible').within(() => { + cy.get('.cvat-opencv-control-popover').within(() => { cy.get('.ant-select-selection-item').then(($labelValue) => { selectedValueGlobal = $labelValue.text(); });