diff --git a/tests/cypress/integration/actions_objects/case_59_edit_handler.js b/tests/cypress/integration/actions_objects/case_59_edit_handler.js index 160d21ca..9ad34b23 100644 --- a/tests/cypress/integration/actions_objects/case_59_edit_handler.js +++ b/tests/cypress/integration/actions_objects/case_59_edit_handler.js @@ -11,7 +11,7 @@ context('Edit handler.', () => { const createPolygonShape = { redraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 450, y: 350 }, { x: 550, y: 350 }, @@ -22,7 +22,7 @@ context('Edit handler.', () => { }; const createPolylinesShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 700, y: 350 }, { x: 800, y: 350 }, @@ -33,7 +33,7 @@ context('Edit handler.', () => { }; const createPointsShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [{ x: 200, y: 400 }], complete: true, numberOfPoints: null, @@ -64,14 +64,12 @@ context('Edit handler.', () => { cy.get('#cvat_canvas_shape_1') .should('have.class', 'cvat_canvas_shape_activated') .invoke('attr', 'points') - .then(($points) => { - const pointsCountBefore = $points.split(' ').filter(function (el) { - return el.length != 0; - }).length; + .then(($pointsBefore) => { + const pointsCountBefore = $pointsBefore.split(' ').filter((el) => el.length !== 0).length; cy.get('.cvat-canvas-container') .click(550, 350, { shiftKey: true }) .then(() => { - //Click on the second polygon points to start of change + // Click on the second polygon points to start of change cy.get('.cvat_canvas_shape_drawing') .should('exist') .and('have.attr', 'data-origin-client-id', '1'); @@ -80,10 +78,8 @@ context('Edit handler.', () => { cy.get('.cvat_canvas_shape_drawing').should('not.exist'); cy.get('#cvat_canvas_shape_1') .invoke('attr', 'points') - .then(($points) => { - const pointsCountAfter = $points.split(' ').filter(function (el) { - return el.length != 0; - }).length; + .then(($pointsAfter) => { + const pointsCountAfter = $pointsAfter.split(' ').filter((el) => el.length !== 0).length; expect(pointsCountBefore).not.equal(pointsCountAfter); // expected 3 to not equal 4 }); // Splitting polygon @@ -116,10 +112,8 @@ context('Edit handler.', () => { .dblclick(530, 400); cy.get('#cvat_canvas_shape_1') .invoke('attr', 'points') - .then(($points) => { - const pointsCountAfterSplitting = $points.split(' ').filter(function (el) { - return el.length != 0; - }).length; + .then(($pointsAfterSplitting) => { + const pointsCountAfterSplitting = $pointsAfterSplitting.split(' ').filter((el) => el.length !== 0).length; expect(pointsCountAfterSplitting).to.be.equal(5); // expected 3 to equal 3 }); }); @@ -152,7 +146,8 @@ context('Edit handler.', () => { cy.get('#cvat_canvas_shape_2') .invoke('attr', 'points') .then(($pointsCordsAfter) => { - // expected '10071.4287109375,9788.5712890625 ...' to not equal '10166.6669921875,9883.8095703125 ...' + // expected '10071.4287109375,9788.5712890625 ...' + // to not equal '10166.6669921875,9883.8095703125 ...' expect($pointsCordsBefore).to.not.equal($pointsCordsAfter); }); }); @@ -207,9 +202,7 @@ context('Edit handler.', () => { .invoke('attr', 'points') .then(($points) => { expect( - $points.split(' ').filter(function (el) { - return el.length != 0; - }).length, + $points.split(' ').filter((el) => el.length !== 0).length, ).to.be.equal(11); }); testActivatingShape(750, 500, '#cvat_canvas_shape_2'); diff --git a/tests/cypress/integration/actions_objects/case_99_save_filtered_object_in_AAM.js b/tests/cypress/integration/actions_objects/case_99_save_filtered_object_in_AAM.js index 2fdd3ba2..9f1c613b 100644 --- a/tests/cypress/integration/actions_objects/case_99_save_filtered_object_in_AAM.js +++ b/tests/cypress/integration/actions_objects/case_99_save_filtered_object_in_AAM.js @@ -13,7 +13,7 @@ context('Save filtered object in AAM.', () => { const createCuboidShape2Points = { points: 'From rectangle', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, @@ -51,7 +51,7 @@ context('Save filtered object in AAM.', () => { }); }); - it(`Go to AAM and change a label for the shape. Save the changes. UI is not failed.`, () => { + it('Go to AAM and change a label for the shape. Save the changes. UI is not failed.', () => { cy.changeWorkspace('Attribute annotation'); cy.changeLabelAAM(secondLabel); cy.saveJob(); diff --git a/tests/cypress/integration/actions_objects2/case_10_polygon_shape_track_label_points.js b/tests/cypress/integration/actions_objects2/case_10_polygon_shape_track_label_points.js index caab9dbf..b9f781b8 100644 --- a/tests/cypress/integration/actions_objects2/case_10_polygon_shape_track_label_points.js +++ b/tests/cypress/integration/actions_objects2/case_10_polygon_shape_track_label_points.js @@ -12,7 +12,7 @@ context('Actions on polygon.', () => { const createPolygonShape = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 200, y: 200 }, { x: 250, y: 200 }, @@ -22,7 +22,7 @@ context('Actions on polygon.', () => { const createPolygonTrack = { reDraw: false, type: 'Track', - labelName: labelName, + labelName, pointsMap: [ { x: 300, y: 200 }, { x: 350, y: 200 }, @@ -32,7 +32,7 @@ context('Actions on polygon.', () => { const createPolygonShapePoints = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 400, y: 200 }, { x: 450, y: 200 }, @@ -45,7 +45,7 @@ context('Actions on polygon.', () => { const createPolygonTrackPoints = { reDraw: false, type: 'Track', - labelName: labelName, + labelName, pointsMap: [ { x: 500, y: 200 }, { x: 550, y: 200 }, @@ -101,23 +101,23 @@ context('Actions on polygon.', () => { }); it('Set start point.', () => { - let notFirtsPointCoords = { + const notFirtsPointCoords = { x: 0, y: 0, }; - let firtsPointCoords = { + const firtsPointCoords = { x: 0, y: 0, }; cy.get('#cvat_canvas_shape_4') - .trigger('mousemove', {scrollBehavior: false}) - .trigger('mouseover', {scrollBehavior: false}) + .trigger('mousemove', { scrollBehavior: false }) + .trigger('mouseover', { scrollBehavior: false }) .should('have.class', 'cvat_canvas_shape_activated'); cy.get('.svg_select_points').not('.cvat_canvas_first_poly_point').first().then((notFirtsPoint) => { notFirtsPointCoords.x = notFirtsPoint.attr('cx'); notFirtsPointCoords.y = notFirtsPoint.attr('cy'); - }).rightclick({scrollBehavior: false}); - cy.get('.cvat-canvas-point-context-menu').contains('span', 'Set start point').click({scrollBehavior: false}); + }).rightclick({ scrollBehavior: false }); + cy.get('.cvat-canvas-point-context-menu').contains('span', 'Set start point').click({ scrollBehavior: false }); cy.get('.cvat_canvas_first_poly_point').then((firtsPoint) => { firtsPointCoords.x = firtsPoint.attr('cx'); firtsPointCoords.y = firtsPoint.attr('cy'); @@ -128,12 +128,12 @@ context('Actions on polygon.', () => { it('Change direction.', () => { let polyDirectionAttrDataAngle; cy.get('#cvat_canvas_shape_4') - .trigger('mousemove', {scrollBehavior: false}) - .trigger('mouseover', {scrollBehavior: false}) + .trigger('mousemove', { scrollBehavior: false }) + .trigger('mouseover', { scrollBehavior: false }) .should('have.class', 'cvat_canvas_shape_activated'); cy.get('.cvat_canvas_poly_direction').then((polyDirection) => { polyDirectionAttrDataAngle = polyDirection.attr('data-angle'); - }).click({scrollBehavior: false}) + }).click({ scrollBehavior: false }); cy.get('.cvat_canvas_poly_direction').then((afterChangePolyDirection) => { expect(polyDirectionAttrDataAngle).not.equal(afterChangePolyDirection.attr('data-angle')); }); diff --git a/tests/cypress/integration/actions_objects2/case_11_polylines_shape_track_label_points.js b/tests/cypress/integration/actions_objects2/case_11_polylines_shape_track_label_points.js index 97263936..6bbb5327 100644 --- a/tests/cypress/integration/actions_objects2/case_11_polylines_shape_track_label_points.js +++ b/tests/cypress/integration/actions_objects2/case_11_polylines_shape_track_label_points.js @@ -11,7 +11,7 @@ context('Actions on polylines.', () => { const newLabelName = `New label for case ${caseId}`; const createPolylinesShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 200, y: 200 }, { x: 250, y: 200 }, @@ -20,7 +20,7 @@ context('Actions on polylines.', () => { }; const createPolylinesTrack = { type: 'Track', - labelName: labelName, + labelName, pointsMap: [ { x: 300, y: 200 }, { x: 350, y: 200 }, @@ -29,7 +29,7 @@ context('Actions on polylines.', () => { }; const createPolylinesShapePoints = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 400, y: 200 }, { x: 450, y: 200 }, @@ -41,7 +41,7 @@ context('Actions on polylines.', () => { }; const createPolylinesTrackPoints = { type: 'Track', - labelName: labelName, + labelName, pointsMap: [ { x: 500, y: 200 }, { x: 550, y: 200 }, @@ -95,17 +95,17 @@ context('Actions on polylines.', () => { }); it('Change direction.', () => { - let firtsPointCoords = { + const firtsPointCoords = { x: 0, y: 0, }; - let lastPointCoords = { + const lastPointCoords = { x: 0, y: 0, }; cy.get('#cvat_canvas_shape_4') - .trigger('mousemove', {scrollBehavior: false}) - .trigger('mouseover', {scrollBehavior: false}) + .trigger('mousemove', { scrollBehavior: false }) + .trigger('mouseover', { scrollBehavior: false }) .should('have.class', 'cvat_canvas_shape_activated'); cy.get('.svg_select_points_point').first().then((firtsPoint) => { firtsPointCoords.x = firtsPoint.attr('cx'); @@ -115,11 +115,11 @@ context('Actions on polylines.', () => { lastPointCoords.y = lastPoint.attr('cy'); cy.get('.cvat_canvas_first_poly_point') .should('have.attr', 'cx', firtsPointCoords.x) - .and('have.attr', 'cy', firtsPointCoords.y) - cy.get('.cvat_canvas_poly_direction').click({scrollBehavior: false}); + .and('have.attr', 'cy', firtsPointCoords.y); + cy.get('.cvat_canvas_poly_direction').click({ scrollBehavior: false }); cy.get('.cvat_canvas_first_poly_point') .should('have.attr', 'cx', lastPointCoords.x) - .and('have.attr', 'cy', lastPointCoords.y) + .and('have.attr', 'cy', lastPointCoords.y); }); }); }); diff --git a/tests/cypress/integration/actions_objects2/case_12_points_shape_track_label.js b/tests/cypress/integration/actions_objects2/case_12_points_shape_track_label.js index c9264552..b5e28452 100644 --- a/tests/cypress/integration/actions_objects2/case_12_points_shape_track_label.js +++ b/tests/cypress/integration/actions_objects2/case_12_points_shape_track_label.js @@ -11,7 +11,7 @@ context('Actions on points.', () => { const newLabelName = `New label for case ${caseId}`; const createPointsShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 200, y: 200 }, { x: 250, y: 200 }, @@ -20,7 +20,7 @@ context('Actions on points.', () => { }; const createPointsTrack = { type: 'Track', - labelName: labelName, + labelName, pointsMap: [ { x: 300, y: 200 }, { x: 350, y: 200 }, @@ -29,7 +29,7 @@ context('Actions on points.', () => { }; const createPointsShapePoints = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 400, y: 200 }, { x: 450, y: 200 }, @@ -41,7 +41,7 @@ context('Actions on points.', () => { }; const createPointsTrackPoints = { type: 'Track', - labelName: labelName, + labelName, pointsMap: [ { x: 500, y: 200 }, { x: 550, y: 200 }, 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 673eb610..351b10fe 100644 --- a/tests/cypress/integration/actions_objects2/case_14_appearance_features.js +++ b/tests/cypress/integration/actions_objects2/case_14_appearance_features.js @@ -15,7 +15,7 @@ context('Appearance features', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 100, firstY: 350, secondX: 200, @@ -24,7 +24,7 @@ context('Appearance features', () => { const createPolygonShape = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 250, y: 350 }, { x: 300, y: 300 }, @@ -35,7 +35,7 @@ context('Appearance features', () => { }; const createPolylinesShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 350, y: 350 }, { x: 400, y: 300 }, @@ -48,7 +48,7 @@ context('Appearance features', () => { const createCuboidShape2Points = { points: 'From rectangle', type: 'Shape', - labelName: labelName, + labelName, firstX: 450, firstY: 350, secondX: 550, @@ -56,7 +56,7 @@ context('Appearance features', () => { }; const createPointsShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [{ x: 650, y: 350 }], complete: true, numberOfPoints: null, @@ -100,7 +100,7 @@ context('Appearance features', () => { } else { expect(Number(object.attr('fill-opacity'))).to.be.gt(Number(fillOpacity)); // expected 1 to be above 0.03 } - }) + }); }); }); }); @@ -163,7 +163,7 @@ context('Appearance features', () => { if (!(text.includes('POLYLINE') || text.includes('POINTS'))) { expect(object.css('fill')).to.be.equal('rgb(224, 224, 224)'); // expected rgb(224, 224, 224) to equal rgb(224, 224, 224) } - }) + }); }); }); diff --git a/tests/cypress/integration/actions_objects2/case_16_z_order_features.js b/tests/cypress/integration/actions_objects2/case_16_z_order_features.js index 86f00e41..ac5e58b5 100644 --- a/tests/cypress/integration/actions_objects2/case_16_z_order_features.js +++ b/tests/cypress/integration/actions_objects2/case_16_z_order_features.js @@ -12,7 +12,7 @@ context('Actions on polygon', () => { const createPolygonShapeFirst = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 340, y: 200 }, { x: 590, y: 200 }, @@ -24,7 +24,7 @@ context('Actions on polygon', () => { const createPolygonShapeSecond = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 190, y: 210 }, { x: 440, y: 210 }, diff --git a/tests/cypress/integration/actions_objects2/case_17_lock_hide_features.js b/tests/cypress/integration/actions_objects2/case_17_lock_hide_features.js index ee61914b..2eccb894 100644 --- a/tests/cypress/integration/actions_objects2/case_17_lock_hide_features.js +++ b/tests/cypress/integration/actions_objects2/case_17_lock_hide_features.js @@ -16,7 +16,7 @@ context('Lock/hide features.', () => { const createPolygonShape = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 200, y: 200 }, { x: 250, y: 200 }, @@ -28,7 +28,7 @@ context('Lock/hide features.', () => { const createRectangleTrack2Points = { points: 'By 2 Points', type: 'Track', - labelName: labelName, + labelName, firstX: 260, firstY: 200, secondX: 360, @@ -37,7 +37,7 @@ context('Lock/hide features.', () => { const createCuboidShape4Points = { points: 'By 4 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 400, firstY: 350, secondX: 500, @@ -198,7 +198,8 @@ context('Lock/hide features.', () => { 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 + // expected 95 to be below 104 + expect(Math.floor(shapeWidth)).to.be.lessThan(Math.floor($shapeWidth)); }); }); it('Go to polygon. Pinned is set to true by default. Set it to false. Polygon can be moved.', () => { @@ -254,7 +255,8 @@ context('Lock/hide features.', () => { cy.get('.ant-select-selection-item').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', diff --git a/tests/cypress/integration/actions_objects2/case_77_cropping_polygon_in_some_corner_cases.js b/tests/cypress/integration/actions_objects2/case_77_cropping_polygon_in_some_corner_cases.js index fc85792f..93887c5e 100644 --- a/tests/cypress/integration/actions_objects2/case_77_cropping_polygon_in_some_corner_cases.js +++ b/tests/cypress/integration/actions_objects2/case_77_cropping_polygon_in_some_corner_cases.js @@ -11,7 +11,7 @@ context('Cropping polygon in some corner cases.', () => { const createPolygonShapeRightSide = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 500, y: 120 }, { x: 900, y: 10 }, @@ -25,7 +25,7 @@ context('Cropping polygon in some corner cases.', () => { const createPolygonShapeLeftSide = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 500, y: 120 }, { x: 30, y: 10 }, diff --git a/tests/cypress/integration/actions_objects2/case_9_cuboid_shape_track_label.js b/tests/cypress/integration/actions_objects2/case_9_cuboid_shape_track_label.js index 41afdfed..6f542a16 100644 --- a/tests/cypress/integration/actions_objects2/case_9_cuboid_shape_track_label.js +++ b/tests/cypress/integration/actions_objects2/case_9_cuboid_shape_track_label.js @@ -12,7 +12,7 @@ context('Actions on Cuboid', () => { const createCuboidShape2Points = { points: 'From rectangle', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, @@ -21,7 +21,7 @@ context('Actions on Cuboid', () => { const createCuboidShape4Points = { points: 'By 4 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 400, firstY: 350, secondX: 500, @@ -34,7 +34,7 @@ context('Actions on Cuboid', () => { const createCuboidTrack2Points = { points: 'From rectangle', type: 'Track', - labelName: labelName, + labelName, firstX: createCuboidShape2Points.firstX, firstY: createCuboidShape2Points.firstY - 150, secondX: createCuboidShape2Points.secondX, @@ -43,7 +43,7 @@ context('Actions on Cuboid', () => { const createCuboidTrack4Points = { points: 'By 4 Points', type: 'Track', - labelName: labelName, + labelName, firstX: createCuboidShape4Points.firstX, firstY: createCuboidShape4Points.firstY - 150, secondX: createCuboidShape4Points.secondX - 100, diff --git a/tests/cypress/integration/actions_tasks/case_67_intelligent_polygon_cropping.js b/tests/cypress/integration/actions_tasks/case_67_intelligent_polygon_cropping.js index e3c55832..76875dc6 100644 --- a/tests/cypress/integration/actions_tasks/case_67_intelligent_polygon_cropping.js +++ b/tests/cypress/integration/actions_tasks/case_67_intelligent_polygon_cropping.js @@ -11,7 +11,7 @@ context('Settings "Intelligent polygon cropping".', () => { const createPolygonShape = { redraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 450, y: 350 }, { x: 550, y: 350 }, @@ -28,9 +28,7 @@ context('Settings "Intelligent polygon cropping".', () => { .invoke('attr', 'points') .then(($points) => { expect( - $points.split(' ').filter(function (el) { - return el.length != 0; - }).length, + $points.split(' ').filter((el) => el.length !== 0).length, ).to.be.equal(expectedCount); }); } @@ -42,16 +40,18 @@ context('Settings "Intelligent polygon cropping".', () => { function testCheckedIntelligentPolygonCropping(uncheck) { cy.openSettings(); cy.contains('[role="tab"]', 'Workspace').click(); - uncheck - ? cy - .get('.cvat-workspace-settings-intelligent-polygon-cropping') - .find('[type="checkbox"]') - .uncheck() - .should('not.be.checked') - : cy - .get('.cvat-workspace-settings-intelligent-polygon-cropping') - .find('[type="checkbox"]') - .should('be.checked'); + if (uncheck) { + cy + .get('.cvat-workspace-settings-intelligent-polygon-cropping') + .find('[type="checkbox"]') + .uncheck() + .should('not.be.checked'); + } else { + cy + .get('.cvat-workspace-settings-intelligent-polygon-cropping') + .find('[type="checkbox"]') + .should('be.checked'); + } cy.closeSettings(); } @@ -62,7 +62,8 @@ context('Settings "Intelligent polygon cropping".', () => { describe(`Testing case "${caseId}"`, () => { it('Check settings "Intelligent polygon cropping".', () => { - testCheckedIntelligentPolygonCropping(); // Check settings "Intelligent polygon cropping". Should be checked by default + // Check settings "Intelligent polygon cropping". Should be checked by default + testCheckedIntelligentPolygonCropping(); cy.get('#cvat_canvas_shape_1') .trigger('mousemove', { scrollBehavior: false }) .should('have.class', 'cvat_canvas_shape_activated'); diff --git a/tests/cypress/integration/actions_tasks/case_70_mutable_attribute.js b/tests/cypress/integration/actions_tasks/case_70_mutable_attribute.js index ef938ad7..a03cbf52 100644 --- a/tests/cypress/integration/actions_tasks/case_70_mutable_attribute.js +++ b/tests/cypress/integration/actions_tasks/case_70_mutable_attribute.js @@ -10,7 +10,9 @@ context('Mutable attribute.', () => { const caseId = '70'; const labelTrack = `Case ${caseId}`; const additionalAttrsLabelShape = [ - { additionalAttrName: 'tree', additionalValue: 'birch tree', typeAttribute: 'Text', mutable: true }, + { + additionalAttrName: 'tree', additionalValue: 'birch tree', typeAttribute: 'Text', mutable: true, + }, ]; const createRectangleTrack2Points = { @@ -64,7 +66,8 @@ context('Mutable attribute.', () => { [ [ 0, - `${additionalAttrsLabelShape[0].additionalAttrName}: ${additionalAttrsLabelShape[0].additionalValue}`, + `${additionalAttrsLabelShape[0].additionalAttrName}: ${ + additionalAttrsLabelShape[0].additionalValue}`, ], [1, `${additionalAttrsLabelShape[0].additionalAttrName}: ${attrValueSecondFrame}`], [2, `${additionalAttrsLabelShape[0].additionalAttrName}: ${attrValueThirdFrame}`], diff --git a/tests/cypress/integration/actions_tasks/case_96_create_save_undo_save_redo_save.js b/tests/cypress/integration/actions_tasks/case_96_create_save_undo_save_redo_save.js index fee05693..78133d45 100644 --- a/tests/cypress/integration/actions_tasks/case_96_create_save_undo_save_redo_save.js +++ b/tests/cypress/integration/actions_tasks/case_96_create_save_undo_save_redo_save.js @@ -11,7 +11,7 @@ context('Create an object, save, undo, save, redo, save.', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, diff --git a/tests/cypress/integration/actions_tasks2/case_26_canvas_brightness_contrast_saturation_feature.js b/tests/cypress/integration/actions_tasks2/case_26_canvas_brightness_contrast_saturation_feature.js index 8d08ace8..4159cf7f 100644 --- a/tests/cypress/integration/actions_tasks2/case_26_canvas_brightness_contrast_saturation_feature.js +++ b/tests/cypress/integration/actions_tasks2/case_26_canvas_brightness_contrast_saturation_feature.js @@ -34,7 +34,7 @@ context('Canvas brightness/contrast/saturation feature', () => { describe(`Testing case "${caseId}"`, () => { it('Check apply of settings', () => { - let stringAction = generateString(countActionMoveSlider, 'rightarrow'); + const stringAction = generateString(countActionMoveSlider, 'rightarrow'); cy.get('.cvat-canvas-image-setups-content').within(() => { cy.wrap(classNameSliders).each(($el) => { cy.wrap($el) diff --git a/tests/cypress/integration/actions_tasks2/case_27_undo_redo_feature.js b/tests/cypress/integration/actions_tasks2/case_27_undo_redo_feature.js index 7d01e8ed..423e21e0 100644 --- a/tests/cypress/integration/actions_tasks2/case_27_undo_redo_feature.js +++ b/tests/cypress/integration/actions_tasks2/case_27_undo_redo_feature.js @@ -11,7 +11,7 @@ context('Undo/redo feature', () => { const firstRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 100, firstY: 100, secondX: 150, @@ -20,7 +20,7 @@ context('Undo/redo feature', () => { const secondRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 150, firstY: 150, secondX: 200, @@ -29,7 +29,7 @@ context('Undo/redo feature', () => { const thirdRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 200, firstY: 200, secondX: 250, @@ -45,7 +45,7 @@ context('Undo/redo feature', () => { cy.get('#cvat-objects-sidebar-state-item-1').should(stateFirstObject); cy.get('#cvat-objects-sidebar-state-item-2').should(stateSecondObject); cy.get('#cvat-objects-sidebar-state-item-3').should(stateThirdObject); - }; + } before(() => { cy.openTaskJob(taskName); diff --git a/tests/cypress/integration/actions_tasks3/case_49_settings_show_all_interpolation_tracks.js b/tests/cypress/integration/actions_tasks3/case_49_settings_show_all_interpolation_tracks.js index 5c2f8078..f2f44265 100644 --- a/tests/cypress/integration/actions_tasks3/case_49_settings_show_all_interpolation_tracks.js +++ b/tests/cypress/integration/actions_tasks3/case_49_settings_show_all_interpolation_tracks.js @@ -11,7 +11,7 @@ context('Settings. "Show all interpolation tracks" option.', () => { const createRectangleTrack2Points = { points: 'By 2 Points', type: 'Track', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, 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 14e3315b..867d63fe 100644 --- a/tests/cypress/integration/actions_tasks3/case_5_image_rotate.js +++ b/tests/cypress/integration/actions_tasks3/case_5_image_rotate.js @@ -21,7 +21,7 @@ context('Check if the image is rotated', () => { } function scaleFitImage() { - let scaleBefore, scaleAfter; + let scaleBefore; cy.get('#cvat_canvas_background') .should('have.attr', 'style') .then(($styles) => { @@ -31,7 +31,7 @@ context('Check if the image is rotated', () => { cy.get('#cvat_canvas_background') .should('have.attr', 'style') .then(($styles) => { - scaleAfter = Number($styles.match(/scale\((\d\.\d+)\)/m)[1]); + const scaleAfter = Number($styles.match(/scale\((\d\.\d+)\)/m)[1]); cy.expect(scaleBefore).to.be.greaterThan(scaleAfter); cy.get('#cvat_canvas_content').dblclick(); cy.get('#cvat_canvas_background').should('have.attr', 'style').and('contain', scaleBefore); diff --git a/tests/cypress/integration/actions_users/case_106_email_confirmation_page.js b/tests/cypress/integration/actions_users/case_106_email_confirmation_page.js index 91e08116..42b8f97f 100644 --- a/tests/cypress/integration/actions_users/case_106_email_confirmation_page.js +++ b/tests/cypress/integration/actions_users/case_106_email_confirmation_page.js @@ -5,7 +5,6 @@ /// context('Email confirmation page.', () => { - const caseId = 106; describe(`Testing "Case ${caseId}."`, () => { diff --git a/tests/cypress/integration/canvas3d_functionality/case_84_canvas3d_functionality_cuboid_redraw.js b/tests/cypress/integration/canvas3d_functionality/case_84_canvas3d_functionality_cuboid_redraw.js index cb042543..f5cd7b6a 100644 --- a/tests/cypress/integration/canvas3d_functionality/case_84_canvas3d_functionality_cuboid_redraw.js +++ b/tests/cypress/integration/canvas3d_functionality/case_84_canvas3d_functionality_cuboid_redraw.js @@ -9,11 +9,11 @@ import { taskName, labelName } from '../../support/const_canvas3d'; context('Canvas 3D functionality. Redraw.', () => { const caseId = '84'; const cuboidCreationParams = { - labelName: labelName, + labelName, }; before(() => { - cy.openTask(taskName) + cy.openTask(taskName); cy.openJob(); cy.create3DCuboid(cuboidCreationParams); }); diff --git a/tests/cypress/integration/canvas3d_functionality/case_87_canvas3d_functionality_cuboid_delete.js b/tests/cypress/integration/canvas3d_functionality/case_87_canvas3d_functionality_cuboid_delete.js index 40366613..20e51cf6 100644 --- a/tests/cypress/integration/canvas3d_functionality/case_87_canvas3d_functionality_cuboid_delete.js +++ b/tests/cypress/integration/canvas3d_functionality/case_87_canvas3d_functionality_cuboid_delete.js @@ -9,11 +9,11 @@ import { taskName, labelName } from '../../support/const_canvas3d'; context('Canvas 3D functionality. Delete a cuboid.', () => { const caseId = '87'; const cuboidCreationParams = { - labelName: labelName, + labelName, }; before(() => { - cy.openTask(taskName) + cy.openTask(taskName); cy.openJob(); cy.create3DCuboid(cuboidCreationParams); }); diff --git a/tests/cypress/integration/issues_prs/issue_1919_check_text_attr.js b/tests/cypress/integration/issues_prs/issue_1919_check_text_attr.js index 24d2e078..44462446 100644 --- a/tests/cypress/integration/issues_prs/issue_1919_check_text_attr.js +++ b/tests/cypress/integration/issues_prs/issue_1919_check_text_attr.js @@ -4,7 +4,9 @@ /// -import { taskName, textDefaultValue, attrName, labelName } from '../../support/const'; +import { + taskName, textDefaultValue, attrName, labelName, +} from '../../support/const'; context('Check label attribute changes', () => { const issueId = '1919'; @@ -12,7 +14,7 @@ context('Check label attribute changes', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, diff --git a/tests/cypress/integration/issues_prs/issue_1922_error_canvas_is_busy_at_resize_element.js b/tests/cypress/integration/issues_prs/issue_1922_error_canvas_is_busy_at_resize_element.js index 2c19a8d7..a15727c0 100644 --- a/tests/cypress/integration/issues_prs/issue_1922_error_canvas_is_busy_at_resize_element.js +++ b/tests/cypress/integration/issues_prs/issue_1922_error_canvas_is_busy_at_resize_element.js @@ -11,7 +11,7 @@ context('Check error canvas is busy at resize element', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 100, firstY: 100, secondX: 300, @@ -38,8 +38,7 @@ context('Check error canvas is busy at resize element', () => { }); it('Resize element on second frame and go to previous frame at resizing element', () => { - const secondX = createRectangleShape2Points.secondX; - const secondY = createRectangleShape2Points.secondY; + const { secondX, secondY } = createRectangleShape2Points; cy.get('.cvat-canvas-container') .trigger('mousemove', secondX - 10, secondY - 10) // activate second shape .trigger('mousedown', secondX, secondY, { button: 0 }) diff --git a/tests/cypress/integration/issues_prs/issue_2174_reset_zoom_in_tag_annotation_mode.js b/tests/cypress/integration/issues_prs/issue_2174_reset_zoom_in_tag_annotation_mode.js index 7d005fa7..38fa7e1c 100644 --- a/tests/cypress/integration/issues_prs/issue_2174_reset_zoom_in_tag_annotation_mode.js +++ b/tests/cypress/integration/issues_prs/issue_2174_reset_zoom_in_tag_annotation_mode.js @@ -21,9 +21,9 @@ context('Reset zoom in tag annotation', () => { cy.get('.ant-modal-content').within(() => { cy.contains('Player').click(); cy.get('.cvat-player-settings-reset-zoom-checkbox').within(() => { - if (value == 'check') { + if (value === 'check') { cy.get('[type="checkbox"]').check(); - } else if (value == 'uncheck') { + } else if (value === 'uncheck') { cy.get('[type="checkbox"]').uncheck(); } }); diff --git a/tests/cypress/integration/issues_prs/issue_2306_ui_not_throw_error_specify_one_point.js b/tests/cypress/integration/issues_prs/issue_2306_ui_not_throw_error_specify_one_point.js index ac20a673..45336360 100644 --- a/tests/cypress/integration/issues_prs/issue_2306_ui_not_throw_error_specify_one_point.js +++ b/tests/cypress/integration/issues_prs/issue_2306_ui_not_throw_error_specify_one_point.js @@ -10,7 +10,7 @@ context('Draw a point shape, specify one point', () => { const issueId = '2306'; const createPointsShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [{ x: 500, y: 200 }], numberOfPoints: 1, }; diff --git a/tests/cypress/integration/issues_prs/issue_2418_object_tag_same_labels.js b/tests/cypress/integration/issues_prs/issue_2418_object_tag_same_labels.js index 7d353f62..28e791af 100644 --- a/tests/cypress/integration/issues_prs/issue_2418_object_tag_same_labels.js +++ b/tests/cypress/integration/issues_prs/issue_2418_object_tag_same_labels.js @@ -11,7 +11,7 @@ context('Check hide/unhide functionality from label tab for object and tag with const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 260, firstY: 200, secondX: 360, diff --git a/tests/cypress/integration/issues_prs/issue_2485_navigation_empty_frames.js b/tests/cypress/integration/issues_prs/issue_2485_navigation_empty_frames.js index 834e1f1f..56563f5d 100644 --- a/tests/cypress/integration/issues_prs/issue_2485_navigation_empty_frames.js +++ b/tests/cypress/integration/issues_prs/issue_2485_navigation_empty_frames.js @@ -11,7 +11,7 @@ context('Navigation to empty frames', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, diff --git a/tests/cypress/integration/issues_prs/issue_2486_not_edit_object_aam.js b/tests/cypress/integration/issues_prs/issue_2486_not_edit_object_aam.js index 62d9d942..44446436 100644 --- a/tests/cypress/integration/issues_prs/issue_2486_not_edit_object_aam.js +++ b/tests/cypress/integration/issues_prs/issue_2486_not_edit_object_aam.js @@ -11,7 +11,7 @@ context("Object can't be draggable/resizable in AAM", () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, 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 9ca2ab91..ffc2b3dd 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 @@ -15,7 +15,7 @@ context('Call HOC component each render.', () => { const createPolygonShapePoints = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 200, y: 200 }, { x: 250, y: 200 }, @@ -26,7 +26,7 @@ context('Call HOC component each render.', () => { }; const createPolylinesTrackPoints = { type: 'Track', - labelName: labelName, + labelName, pointsMap: [ { x: 300, y: 200 }, { x: 350, y: 200 }, @@ -38,7 +38,7 @@ context('Call HOC component each render.', () => { }; const createPointsShapePoints = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 400, y: 200 }, { x: 450, y: 200 }, diff --git a/tests/cypress/integration/issues_prs/issue_2807_polyline_editing.js b/tests/cypress/integration/issues_prs/issue_2807_polyline_editing.js index a47f01a1..05f668da 100644 --- a/tests/cypress/integration/issues_prs/issue_2807_polyline_editing.js +++ b/tests/cypress/integration/issues_prs/issue_2807_polyline_editing.js @@ -10,7 +10,7 @@ context('After draw correcting line and press the latest drawn point then it clo const issueId = '2807'; const createPolylinesShapePoints = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 400, y: 400 }, { x: 600, y: 250 }, @@ -18,8 +18,8 @@ context('After draw correcting line and press the latest drawn point then it clo ], numberOfPoints: 3, }; - let svgJsCircle = []; - let svgJsCircleAfterCorrection = []; + const svgJsCircle = []; + const svgJsCircleAfterCorrection = []; function getCircleAndWriteToArr(array) { cy.get('circle').then((circle) => { diff --git a/tests/cypress/integration/issues_prs/issue_2992_crop_polygon_properly.js b/tests/cypress/integration/issues_prs/issue_2992_crop_polygon_properly.js index 8e8713f6..2b701096 100644 --- a/tests/cypress/integration/issues_prs/issue_2992_crop_polygon_properly.js +++ b/tests/cypress/integration/issues_prs/issue_2992_crop_polygon_properly.js @@ -12,7 +12,7 @@ context('Crop polygon properly.', () => { const createPolygonShape = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 200, y: 500 }, { x: 200, y: 200 }, diff --git a/tests/cypress/integration/issues_prs/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js b/tests/cypress/integration/issues_prs/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js index d07d1a20..70ff4230 100644 --- a/tests/cypress/integration/issues_prs/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js +++ b/tests/cypress/integration/issues_prs/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js @@ -11,7 +11,7 @@ context('Check if the UI fails by moving to the next frame while dragging the ob const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, diff --git a/tests/cypress/integration/issues_prs2/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js b/tests/cypress/integration/issues_prs2/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js index 07c96f8f..9475945b 100644 --- a/tests/cypress/integration/issues_prs2/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js +++ b/tests/cypress/integration/issues_prs2/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js @@ -11,7 +11,7 @@ context('Check if UI not fails with shape dragging over sidebar', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, @@ -20,7 +20,7 @@ context('Check if UI not fails with shape dragging over sidebar', () => { const createRectangleShape2PointsSecond = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: createRectangleShape2Points.firstX, firstY: createRectangleShape2Points.firstY - 150, secondX: createRectangleShape2Points.secondX, @@ -34,19 +34,19 @@ context('Check if UI not fails with shape dragging over sidebar', () => { describe(`Testing issue "${issueId}"`, () => { it('Create multiple objects', () => { /* The error was repeated when the number of - objects was more than or equal to 2 */ + objects was more than or equal to 2 */ cy.createRectangle(createRectangleShape2Points); cy.createRectangle(createRectangleShape2PointsSecond); }); it('Shape dragging over sidebar.', () => { - /*To reproduce the error, move the any shape under any - #cvat-objects-sidebar-state-item-*. */ + /* To reproduce the error, move the any shape under any + #cvat-objects-sidebar-state-item-*. */ cy.get('#cvat_canvas_shape_2').trigger('mousemove').trigger('mouseover').trigger('mousedown', { which: 1 }); }); it('There is no error like "Canvas is busy. Action: drag" in the console', () => { cy.get('body') - /*Since cy.click () contains events such as - mousemove, mouseover, etc. Use it to reduce lines of code.*/ + /* Since cy.click () contains events such as + mousemove, mouseover, etc. Use it to reduce lines of code. */ .click(1299, 300); }); }); diff --git a/tests/cypress/integration/issues_prs2/issue_1368_points_track_invisible_next_frame.js b/tests/cypress/integration/issues_prs2/issue_1368_points_track_invisible_next_frame.js index 36d0c526..08ff1917 100644 --- a/tests/cypress/integration/issues_prs2/issue_1368_points_track_invisible_next_frame.js +++ b/tests/cypress/integration/issues_prs2/issue_1368_points_track_invisible_next_frame.js @@ -10,7 +10,7 @@ context('Points track it is still invisible on next frames', () => { const issueId = '1368'; const createPointsTrack = { type: 'Track', - labelName: labelName, + labelName, pointsMap: [{ x: 300, y: 410 }], complete: true, numberOfPoints: null, diff --git a/tests/cypress/integration/issues_prs2/issue_1425_highlighted_attribute_correspond_chosen_attribute.js b/tests/cypress/integration/issues_prs2/issue_1425_highlighted_attribute_correspond_chosen_attribute.js index f2f479a7..9727f8e6 100644 --- a/tests/cypress/integration/issues_prs2/issue_1425_highlighted_attribute_correspond_chosen_attribute.js +++ b/tests/cypress/integration/issues_prs2/issue_1425_highlighted_attribute_correspond_chosen_attribute.js @@ -12,7 +12,7 @@ context('The highlighted attribute in AAM should correspond to the chosen attrib const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, @@ -34,7 +34,7 @@ context('The highlighted attribute in AAM should correspond to the chosen attrib it('Check if highlighted attribute correspond to the chosen attribute in right panel', () => { cy.get('.cvat_canvas_text').within(() => { cy.get('[style="fill: red;"]').then(($textValue) => { - textValue = $textValue.text().split(': ')[1]; + [, textValue] = $textValue.text().split(': '); }); }); cy.get('.cvat-attribute-annotation-sidebar-attr-editor').within(() => { @@ -45,7 +45,7 @@ context('The highlighted attribute in AAM should correspond to the chosen attrib cy.get('.cvat-attribute-annotation-sidebar-attribute-switcher-right').click(); cy.get('.cvat_canvas_text').within(() => { cy.get('[style="fill: red;"]').then(($textValue) => { - textValue = $textValue.text().split(': ')[1]; + [, textValue] = $textValue.text().split(': '); }); }); cy.get('.cvat-attribute-annotation-sidebar-attr-editor').within(() => { diff --git a/tests/cypress/integration/issues_prs2/issue_1429_check_new_label.js b/tests/cypress/integration/issues_prs2/issue_1429_check_new_label.js index fd4617c2..1d630722 100644 --- a/tests/cypress/integration/issues_prs2/issue_1429_check_new_label.js +++ b/tests/cypress/integration/issues_prs2/issue_1429_check_new_label.js @@ -12,7 +12,7 @@ context('Check if the new label reflects in the options', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, diff --git a/tests/cypress/integration/issues_prs2/issue_1438_cancel_multiple_paste_ui_not_lock.js b/tests/cypress/integration/issues_prs2/issue_1438_cancel_multiple_paste_ui_not_lock.js index e90dbe7f..27e090ce 100644 --- a/tests/cypress/integration/issues_prs2/issue_1438_cancel_multiple_paste_ui_not_lock.js +++ b/tests/cypress/integration/issues_prs2/issue_1438_cancel_multiple_paste_ui_not_lock.js @@ -11,7 +11,7 @@ context('Cancel "multiple paste". UI is not locked.', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, diff --git a/tests/cypress/integration/issues_prs2/issue_1444_filter_property_shape.js b/tests/cypress/integration/issues_prs2/issue_1444_filter_property_shape.js index 5fb8635c..895e72fc 100644 --- a/tests/cypress/integration/issues_prs2/issue_1444_filter_property_shape.js +++ b/tests/cypress/integration/issues_prs2/issue_1444_filter_property_shape.js @@ -11,7 +11,7 @@ context('Filter property "shape" work correctly', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, @@ -20,7 +20,7 @@ context('Filter property "shape" work correctly', () => { const createPolygonShape = { reDraw: false, type: 'Shape', - labelName: labelName, + labelName, pointsMap: [ { x: 300, y: 100 }, { x: 400, y: 400 }, diff --git a/tests/cypress/integration/issues_prs2/issue_1498_message_ui_raw_labels_wrong.js b/tests/cypress/integration/issues_prs2/issue_1498_message_ui_raw_labels_wrong.js index 53025f2c..c3839969 100644 --- a/tests/cypress/integration/issues_prs2/issue_1498_message_ui_raw_labels_wrong.js +++ b/tests/cypress/integration/issues_prs2/issue_1498_message_ui_raw_labels_wrong.js @@ -4,11 +4,13 @@ /// -import { taskName, labelName, attrName, textDefaultValue } from '../../support/const'; +import { + taskName, labelName, attrName, textDefaultValue, +} from '../../support/const'; context('Message in UI when raw labels are wrong.', () => { const issueId = '1498'; - let taskRaw = [ + const taskRaw = [ { name: labelName, id: 1, @@ -45,9 +47,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "name" as a number.', () => { - let taskRawNameNumber = JSON.parse(JSON.stringify(taskRaw)); + const taskRawNameNumber = JSON.parse(JSON.stringify(taskRaw)); taskRawNameNumber[0].name = 1; - let jsonNameNumber = JSON.stringify(taskRawNameNumber); + const jsonNameNumber = JSON.stringify(taskRawNameNumber); cy.get('#labels').type(jsonNameNumber, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -57,9 +59,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "id" as a string.', () => { - let taskRawLabelString = JSON.parse(JSON.stringify(taskRaw)); + const taskRawLabelString = JSON.parse(JSON.stringify(taskRaw)); taskRawLabelString[0].id = '1'; - let jsonLabelString = JSON.stringify(taskRawLabelString); + const jsonLabelString = JSON.stringify(taskRawLabelString); cy.get('#labels').type(jsonLabelString, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -69,9 +71,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "attributes" as a number.', () => { - let taskRawAttrNumber = JSON.parse(JSON.stringify(taskRaw)); + const taskRawAttrNumber = JSON.parse(JSON.stringify(taskRaw)); taskRawAttrNumber[0].attributes = 1; - let jsonAttrNumber = JSON.stringify(taskRawAttrNumber); + const jsonAttrNumber = JSON.stringify(taskRawAttrNumber); cy.get('#labels').type(jsonAttrNumber, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -81,9 +83,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "color" as a number.', () => { - let taskRawColorNumber = JSON.parse(JSON.stringify(taskRaw)); + const taskRawColorNumber = JSON.parse(JSON.stringify(taskRaw)); taskRawColorNumber[0].color = 1; - let jsonColorNumber = JSON.stringify(taskRawColorNumber); + const jsonColorNumber = JSON.stringify(taskRawColorNumber); cy.get('#labels').type(jsonColorNumber, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -93,9 +95,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "attributes id" as a string.', () => { - let taskRawAttrIdString = JSON.parse(JSON.stringify(taskRaw)); + const taskRawAttrIdString = JSON.parse(JSON.stringify(taskRaw)); taskRawAttrIdString[0].attributes[0].id = '1'; - let jsonAttrIdString = JSON.stringify(taskRawAttrIdString); + const jsonAttrIdString = JSON.stringify(taskRawAttrIdString); cy.get('#labels').type(jsonAttrIdString, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -106,10 +108,10 @@ context('Message in UI when raw labels are wrong.', () => { }); it('Label "attributes input_type" is incorrect.', () => { const inputTypes = ['select radio', 'textt', 'nnumber']; - let taskRawAttrTypeNumber = JSON.parse(JSON.stringify(taskRaw)); - for (let type of inputTypes) { + const taskRawAttrTypeNumber = JSON.parse(JSON.stringify(taskRaw)); + for (const type of inputTypes) { taskRawAttrTypeNumber[0].attributes[0].input_type = type; - let jsonAttrTypeNumber = JSON.stringify(taskRawAttrTypeNumber); + const jsonAttrTypeNumber = JSON.stringify(taskRawAttrTypeNumber); cy.get('#labels').type(jsonAttrTypeNumber, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -121,9 +123,9 @@ context('Message in UI when raw labels are wrong.', () => { } }); it('Label "attributes mutable" as a number.', () => { - let taskRawAttrMutableNumber = JSON.parse(JSON.stringify(taskRaw)); + const taskRawAttrMutableNumber = JSON.parse(JSON.stringify(taskRaw)); taskRawAttrMutableNumber[0].attributes[0].mutable = 1; - let jsonAttrMutableNumber = JSON.stringify(taskRawAttrMutableNumber); + const jsonAttrMutableNumber = JSON.stringify(taskRawAttrMutableNumber); cy.get('#labels').type(jsonAttrMutableNumber, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -133,9 +135,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "attributes values" as a number.', () => { - let taskRawAttrValuesNumber = JSON.parse(JSON.stringify(taskRaw)); + const taskRawAttrValuesNumber = JSON.parse(JSON.stringify(taskRaw)); taskRawAttrValuesNumber[0].attributes[0].values = 1; - let jsonAttrValueNumber = JSON.stringify(taskRawAttrValuesNumber); + const jsonAttrValueNumber = JSON.stringify(taskRawAttrValuesNumber); cy.get('#labels').type(jsonAttrValueNumber, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -145,9 +147,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "attributes values" as a array with number.', () => { - let taskRawAttrValuesNumberArr = JSON.parse(JSON.stringify(taskRaw)); + const taskRawAttrValuesNumberArr = JSON.parse(JSON.stringify(taskRaw)); taskRawAttrValuesNumberArr[0].attributes[0].values = [1]; - let jsonAttrValuesNumberArr = JSON.stringify(taskRawAttrValuesNumberArr); + const jsonAttrValuesNumberArr = JSON.stringify(taskRawAttrValuesNumberArr); cy.get('#labels').type(jsonAttrValuesNumberArr, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -157,9 +159,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "attributes name" as a number.', () => { - let taskRawAttrNameNumber = JSON.parse(JSON.stringify(taskRaw)); + const taskRawAttrNameNumber = JSON.parse(JSON.stringify(taskRaw)); taskRawAttrNameNumber[0].attributes[0].name = 1; - let jsonAttrNameNumber = JSON.stringify(taskRawAttrNameNumber); + const jsonAttrNameNumber = JSON.stringify(taskRawAttrNameNumber); cy.get('#labels').type(jsonAttrNameNumber, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') @@ -169,9 +171,9 @@ context('Message in UI when raw labels are wrong.', () => { }); }); it('Label "attributes values" as a empty array.', () => { - let taskRawAttrValuesEmptyArr = JSON.parse(JSON.stringify(taskRaw)); + const taskRawAttrValuesEmptyArr = JSON.parse(JSON.stringify(taskRaw)); taskRawAttrValuesEmptyArr[0].attributes[0].values = []; - let jsonAttrValuesEmptyArr = JSON.stringify(taskRawAttrValuesEmptyArr); + const jsonAttrValuesEmptyArr = JSON.stringify(taskRawAttrValuesEmptyArr); cy.get('#labels').type(jsonAttrValuesEmptyArr, { parseSpecialCharSequences: false }); cy.get('.ant-form-item-explain') .should('exist') diff --git a/tests/cypress/integration/issues_prs2/issue_1750_err_aam_switch_frames.js b/tests/cypress/integration/issues_prs2/issue_1750_err_aam_switch_frames.js index 278c8c5b..57e325fb 100644 --- a/tests/cypress/integration/issues_prs2/issue_1750_err_aam_switch_frames.js +++ b/tests/cypress/integration/issues_prs2/issue_1750_err_aam_switch_frames.js @@ -11,7 +11,7 @@ context('An error occurs in AAM when switching to 2 frames, if the frames have o const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, @@ -20,7 +20,7 @@ context('An error occurs in AAM when switching to 2 frames, if the frames have o const createRectangleShape2PointsSecond = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: createRectangleShape2Points.firstX, firstY: createRectangleShape2Points.firstY - 150, secondX: createRectangleShape2Points.secondX, diff --git a/tests/cypress/integration/issues_prs2/issue_1823_opening_context_menu_when_switching_another_frame.js b/tests/cypress/integration/issues_prs2/issue_1823_opening_context_menu_when_switching_another_frame.js index 28067b9c..30e18e73 100644 --- a/tests/cypress/integration/issues_prs2/issue_1823_opening_context_menu_when_switching_another_frame.js +++ b/tests/cypress/integration/issues_prs2/issue_1823_opening_context_menu_when_switching_another_frame.js @@ -43,7 +43,7 @@ context('Cannot read property label of undefined', { browser: ['!chrome', '!fire const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, diff --git a/tests/cypress/integration/issues_prs2/issue_1825_tooltip_hidden_mouseout.js b/tests/cypress/integration/issues_prs2/issue_1825_tooltip_hidden_mouseout.js index 99865cbd..268c3778 100644 --- a/tests/cypress/integration/issues_prs2/issue_1825_tooltip_hidden_mouseout.js +++ b/tests/cypress/integration/issues_prs2/issue_1825_tooltip_hidden_mouseout.js @@ -20,10 +20,10 @@ context('Tooltip does not interfere with interaction with elements.', () => { cy.contains('Shape').invoke('show').trigger('mouseover', 'top').should('have.class', 'ant-tooltip-open'); }); it('The radio element was clicked successfully', () => { - /*Before the fix, cypress can't click on the radio element - due to its covered with the tooltip. After the fix, cypress - successfully clicks on the element, but the tooltip does not - disappear visually.*/ + /* Before the fix, cypress can't click on the radio element + due to its covered with the tooltip. After the fix, cypress + successfully clicks on the element, but the tooltip does not + disappear visually. */ cy.contains('By 4 Points').click(); }); }); diff --git a/tests/cypress/integration/issues_prs2/issue_1841_hidden_points_cuboids_grouping.js b/tests/cypress/integration/issues_prs2/issue_1841_hidden_points_cuboids_grouping.js index 61fd536a..7c9c83eb 100644 --- a/tests/cypress/integration/issues_prs2/issue_1841_hidden_points_cuboids_grouping.js +++ b/tests/cypress/integration/issues_prs2/issue_1841_hidden_points_cuboids_grouping.js @@ -4,7 +4,7 @@ /// - import { taskName, labelName } from '../../support/const'; +import { taskName, labelName } from '../../support/const'; context( "Hidden objects mustn't consider when we want to group visible objects only and use an grouping area for it.", @@ -13,21 +13,21 @@ context( let bgcolor = ''; const createFirstPointsShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [{ x: 300, y: 410 }], complete: true, numberOfPoints: null, }; const createSecondPointsShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [{ x: 350, y: 410 }], complete: true, numberOfPoints: null, }; const createThirdPointsShape = { type: 'Shape', - labelName: labelName, + labelName, pointsMap: [{ x: 400, y: 410 }], complete: true, numberOfPoints: null, diff --git a/tests/cypress/integration/issues_prs2/issue_1870_cursor_not_jump_to_end.js b/tests/cypress/integration/issues_prs2/issue_1870_cursor_not_jump_to_end.js index 67ab06c3..38dcf641 100644 --- a/tests/cypress/integration/issues_prs2/issue_1870_cursor_not_jump_to_end.js +++ b/tests/cypress/integration/issues_prs2/issue_1870_cursor_not_jump_to_end.js @@ -4,7 +4,9 @@ /// -import { taskName, textDefaultValue, attrName, labelName } from '../../support/const'; +import { + taskName, textDefaultValue, attrName, labelName, +} from '../../support/const'; context( "Checks that the cursor doesn't automatically jump to the end of a word when the attribute value changes", @@ -13,7 +15,7 @@ context( const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - labelName: labelName, + labelName, firstX: 250, firstY: 350, secondX: 350, diff --git a/tests/cypress/plugins/compareImages/addPlugin.js b/tests/cypress/plugins/compareImages/addPlugin.js index a1deac87..8a988a63 100644 --- a/tests/cypress/plugins/compareImages/addPlugin.js +++ b/tests/cypress/plugins/compareImages/addPlugin.js @@ -2,9 +2,6 @@ // // SPDX-License-Identifier: MIT -// eslint-disable-next-line no-undef -exports.compareImages = compareImages; - const Jimp = require('jimp'); async function compareImages(args) { @@ -14,3 +11,5 @@ async function compareImages(args) { return diff.percent; } + +exports.compareImages = compareImages; diff --git a/tests/cypress/plugins/compareImages/compareImagesCommand.js b/tests/cypress/plugins/compareImages/compareImagesCommand.js index 94bf7071..26655fe0 100644 --- a/tests/cypress/plugins/compareImages/compareImagesCommand.js +++ b/tests/cypress/plugins/compareImages/compareImagesCommand.js @@ -2,9 +2,10 @@ // // SPDX-License-Identifier: MIT -Cypress.Commands.add('compareImages', function (imgBase, imgAfterChanges) { - return cy.task('compareImages', { - imgBase: imgBase, - imgAfterChanges: imgAfterChanges, - }); -}); +Cypress.Commands.add( + 'compareImages', + (imgBase, imgAfterChanges) => cy.task('compareImages', { + imgBase, + imgAfterChanges, + }), +); diff --git a/tests/cypress/support/const_canvas3d.js b/tests/cypress/support/const_canvas3d.js index bf8d29bc..a448ef21 100644 --- a/tests/cypress/support/const_canvas3d.js +++ b/tests/cypress/support/const_canvas3d.js @@ -4,8 +4,8 @@ /// -export const labelName = `points cloud`; -export const taskName = `Canvas 3D functionality`; +export const labelName = 'points cloud'; +export const taskName = 'Canvas 3D functionality'; export const pcdPngZipArr = '../../cypress/integration/canvas3d_functionality/assets/test_canvas3d.zip'; export const attrName = `Attr for ${labelName}`; export const textDefaultValue = 'Some default value for type Text'; @@ -16,7 +16,7 @@ it('Prepare to testing', () => { cy.visit('/'); cy.login(); cy.get('.cvat-tasks-page').should('exist'); - let listItems = []; + const listItems = []; cy.document().then((doc) => { const collection = Array.from(doc.querySelectorAll('.cvat-item-task-name')); for (let i = 0; i < collection.length; i++) { diff --git a/tests/cypress/support/const_project.js b/tests/cypress/support/const_project.js index f1950a7e..93a6c147 100644 --- a/tests/cypress/support/const_project.js +++ b/tests/cypress/support/const_project.js @@ -9,8 +9,8 @@ export const labelName = `Base label for ${projectName}`; export const attrName = `Attr for ${labelName}`; export const textDefaultValue = 'Some default value for type Text'; export const multiAttrParams = { - additionalAttrName: `Attr 2`, - additionalValue: `Attr value 2`, + additionalAttrName: 'Attr 2', + additionalValue: 'Attr value 2', typeAttribute: 'Text', }; @@ -19,7 +19,7 @@ it('Prepare to testing', () => { cy.login(); cy.goToProjectsList(); cy.get('.cvat-projects-page').should('exist'); - let listItems = []; + const listItems = []; cy.document().then((doc) => { const collection = Array.from(doc.querySelectorAll('.cvat-projects-project-item-title')); for (let i = 0; i < collection.length; i++) {