Cypress. Enabled check text with an ellipse rotation. (#4230)

* Enabled check text with Ellipse rotation

* Added dafult value to arg
main
Dmitry Kruchinin 4 years ago committed by GitHub
parent 5ccc596888
commit 85cb87bf31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -78,8 +78,6 @@ context('Actions on ellipse.', () => {
(createEllipseTrackSwitchLabel.rightX + createEllipseTrackSwitchLabel.cx) / 2,
createEllipseTrackSwitchLabel.topY + 20,
'53.1',
false,
false,
);
testCompareRotate('cvat_canvas_shape_4', 0);
// Rotation with shift
@ -89,7 +87,6 @@ context('Actions on ellipse.', () => {
createEllipseTrackSwitchLabel.topY + 20,
'60.0',
true,
false,
);
});
});

@ -802,8 +802,7 @@ Cypress.Commands.add('exportTask', ({
cy.closeNotification('.cvat-notification-notice-export-task-start');
});
// FIXME: remove "checkText" after implementstion for ellipse
Cypress.Commands.add('shapeRotate', (shape, x, y, expectedRotateDeg, pressShift, checkText = true) => {
Cypress.Commands.add('shapeRotate', (shape, x, y, expectedRotateDeg, pressShift = false) => {
cy.get(shape)
.trigger('mousemove')
.trigger('mouseover')
@ -821,9 +820,7 @@ Cypress.Commands.add('shapeRotate', (shape, x, y, expectedRotateDeg, pressShift,
cy.document().then((doc) => {
const modShapeIDString = shape.substring(1); // Remove "#" from the shape id string
const shapeTranformMatrix = decomposeMatrix(doc.getElementById(modShapeIDString).getCTM());
if (checkText) {
cy.get('#cvat_canvas_text_content').should('contain.text', `${shapeTranformMatrix}°`);
}
cy.get('#cvat_canvas_text_content').should('contain.text', `${shapeTranformMatrix}°`);
expect(`${expectedRotateDeg}°`).to.be.equal(`${shapeTranformMatrix}°`);
});
cy.get('.cvat-canvas-container').trigger('mouseup');

Loading…
Cancel
Save