Skip to content

Commit

Permalink
Cypress. Fix case "Image rotate" for Firefox. (#2857)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
dvkruchinin authored Feb 25, 2021
1 parent f8ce8c1 commit 1e33901
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
});
}
Expand Down

0 comments on commit 1e33901

Please sign in to comment.