From 1e3390130f312a042653d0d5df874ee3b38c9be0 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Thu, 25 Feb 2021 18:39:03 +0300 Subject: [PATCH] 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. --- .../integration/actions_tasks_objects/case_5_image_rotate.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/cypress/integration/actions_tasks_objects/case_5_image_rotate.js b/tests/cypress/integration/actions_tasks_objects/case_5_image_rotate.js index 2bed40e2..2a237220 100644 --- a/tests/cypress/integration/actions_tasks_objects/case_5_image_rotate.js +++ b/tests/cypress/integration/actions_tasks_objects/case_5_image_rotate.js @@ -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); }); }