Fix most ESLint errors/warnings in tests (#5647)

After this, there's only 12 files with ESLint errors left. I didn't fix
those because they all have at least one
`cypress/no-unnecessary-waiting` error, and I don't have enough Cypress
expertise to fix those.
main
Roman Donchenko 3 years ago committed by GitHub
parent 3775bc2557
commit f82d7f520e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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');

@ -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();

@ -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'));
});

@ -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);
});
});
});

@ -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 },

@ -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)
}
})
});
});
});

@ -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 },

@ -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',

@ -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 },

@ -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,

@ -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');

@ -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}`],

@ -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,

@ -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)

@ -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);

@ -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,

@ -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);

@ -5,7 +5,6 @@
/// <reference types="cypress" />
context('Email confirmation page.', () => {
const caseId = 106;
describe(`Testing "Case ${caseId}."`, () => {

@ -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);
});

@ -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);
});

@ -4,7 +4,9 @@
/// <reference types="cypress" />
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,

@ -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 })

@ -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();
}
});

@ -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,
};

@ -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,

@ -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,

@ -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,

@ -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 },

@ -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) => {

@ -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 },

@ -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,

@ -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);
});
});

@ -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,

@ -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(() => {

@ -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,

@ -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,

@ -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 },

@ -4,11 +4,13 @@
/// <reference types="cypress" />
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')

@ -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,

@ -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,

@ -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();
});
});

@ -4,7 +4,7 @@
/// <reference types="cypress" />
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,

@ -4,7 +4,9 @@
/// <reference types="cypress" />
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,

@ -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;

@ -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,
}),
);

@ -4,8 +4,8 @@
/// <reference types="cypress" />
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++) {

@ -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++) {

Loading…
Cancel
Save