Cypress. Fix case "Image rotate" for Firefox. (#2857)

* Cypress. Fix case 5 for Firefox.

* Decrease time to wait. Add condition.

* Remove wait().

Add an additional click on the canvas for hide the popover.
main
Dmitry Kruchinin 5 years ago committed by GitHub
parent f8ce8c13c0
commit 1e3390130f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,11 +11,14 @@ context('Check if the image is rotated', () => {
function imageRotate(direction = 'anticlockwise') {
cy.get('.cvat-rotate-canvas-control').trigger('mouseover');
cy.get('.cvat-rotate-canvas-popover-visible').should('exist');
if (direction === 'clockwise') {
cy.get('.cvat-rotate-canvas-controls-right').click();
} else {
cy.get('.cvat-rotate-canvas-controls-left').click();
}
cy.get('.cvat-canvas-container').click(); // Hide popover
cy.get('.cvat-rotate-canvas-popover-visible').should('not.exist');
}
function scaleFitImage() {
@ -32,6 +35,7 @@ context('Check if the image is rotated', () => {
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-rotate-canvas-popover-visible').should('not.exist');
cy.get('#cvat_canvas_background').should('have.attr', 'style').and('contain', scaleBefore);
});
}

Loading…
Cancel
Save