Cypress test. Update case 10, 11. Added steps "Set start point", "Change direction". (#3468)

* Added step "Set start point" for polygon.

* Added step "Change direction" for polygon.

* Added step "Change direction" for a polyline

* Apply comments
main
Dmitry Kruchinin 5 years ago committed by GitHub
parent 697878df78
commit 746b062814
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -91,17 +91,58 @@ context('Actions on polygon', () => {
});
describe(`Testing case "${caseId}"`, () => {
it('Draw a polygon shape, track', () => {
it('Draw a polygon shape, track.', () => {
cy.createPolygon(createPolygonShape);
cy.createPolygon(createPolygonTrack);
});
it('Draw a polygon shape, track with use parameter "number of points"', () => {
it('Draw a polygon shape, track with use parameter "number of points".', () => {
cy.createPolygon(createPolygonShapePoints);
cy.createPolygon(createPolygonTrackPoints);
});
it('Draw a polygon shape, track with second label', () => {
it('Draw a polygon shape, track with second label.', () => {
cy.createPolygon(createPolygonShapeSwitchLabel);
cy.createPolygon(createPolygonTrackSwitchLabel);
});
it('Set start point.', () => {
let notFirtsPointCoords = {
x: 0,
y: 0,
};
let firtsPointCoords = {
x: 0,
y: 0,
};
cy.get('#cvat_canvas_shape_4')
.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});
cy.get('.cvat_canvas_first_poly_point').then((firtsPoint) => {
firtsPointCoords.x = firtsPoint.attr('cx');
firtsPointCoords.y = firtsPoint.attr('cy');
expect(notFirtsPointCoords).to.deep.equal(firtsPointCoords);
});
});
it('Change direction.', () => {
let polyDirectionAttrDataAngle;
cy.get('#cvat_canvas_shape_4')
.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})
cy.get('.cvat_canvas_poly_direction').then((afterChangePolyDirection) => {
expect(polyDirectionAttrDataAngle).not.equal(afterChangePolyDirection.attr('data-angle'));
});
});
});
});

@ -85,17 +85,49 @@ context('Actions on polylines', () => {
});
describe(`Testing case "${caseId}"`, () => {
it('Draw a polylines shape, track', () => {
it('Draw a polylines shape, track.', () => {
cy.createPolyline(createPolylinesShape);
cy.createPolyline(createPolylinesTrack);
});
it('Draw a polylines shape, track with use parameter "number of points"', () => {
it('Draw a polylines shape, track with use parameter "number of points".', () => {
cy.createPolyline(createPolylinesShapePoints);
cy.createPolyline(createPolylinesTrackPoints);
});
it('Draw a polylines shape, track with second label', () => {
it('Draw a polylines shape, track with second label.', () => {
cy.createPolyline(createPolylinesShapeSwitchLabel);
cy.createPolyline(createPolylinesTrackSwitchLabel);
});
it('Change direction.', () => {
let firtsPointCoords = {
x: 0,
y: 0,
};
let lastPointCoords = {
x: 0,
y: 0,
};
cy.get('#cvat_canvas_shape_4')
.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');
firtsPointCoords.y = firtsPoint.attr('cy');
cy.get('.svg_select_points_point').last().then((lastPoint) => {
lastPointCoords.x = lastPoint.attr('cx');
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});
cy.get('.cvat_canvas_first_poly_point')
.should('have.attr', 'cx', lastPointCoords.x)
.and('have.attr', 'cy', lastPointCoords.y)
});
});
});
});
});

Loading…
Cancel
Save