From 6351df07d17e0ec7766c27b90a0b7a2fedc86776 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin Date: Fri, 3 Dec 2021 09:05:06 +0300 Subject: [PATCH] Cypress. Fix case 108 for Firefox. (#3981) * Fix case 108 for Firefox * Remove unnecessary code * Update step Co-authored-by: dvkruchinin --- .../case_108_rotated_bounding_boxes.js | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/cypress/integration/actions_objects2/case_108_rotated_bounding_boxes.js b/tests/cypress/integration/actions_objects2/case_108_rotated_bounding_boxes.js index 542006b7..ea466b34 100644 --- a/tests/cypress/integration/actions_objects2/case_108_rotated_bounding_boxes.js +++ b/tests/cypress/integration/actions_objects2/case_108_rotated_bounding_boxes.js @@ -49,10 +49,12 @@ context('Rotated bounding boxes.', () => { function testCompareRotate(shape, toFrame) { for (let frame = 8; frame >= toFrame; frame--) { - cy.get(shape).invoke('css', 'transform').then(($transform) => { + cy.document().then((doc) => { + const shapeTranformMatrix = doc.getElementById(shape).getCTM(); cy.goToPreviousFrame(frame); - cy.get(shape).invoke('css', 'transform').then(($transform2) => { - expect($transform).not.eq($transform2); + cy.document().then((doc2) => { + const shapeTranformMatrix2 = doc2.getElementById(shape).getCTM(); + expect(shapeTranformMatrix).not.deep.eq(shapeTranformMatrix2); }); }); } @@ -77,11 +79,13 @@ context('Rotated bounding boxes.', () => { it('Check interpolation, merging/splitting rotated shapes.', () => { // Check track roration on all frames - cy.get('#cvat_canvas_shape_2').invoke('css', 'transform').then((shape2) => { + cy.document().then((doc) => { + const shapeTranformMatrix = doc.getElementById('cvat_canvas_shape_2').getCTM(); for (let frame = 1; frame < 10; frame++) { cy.goToNextFrame(frame); - cy.get('#cvat_canvas_shape_2').invoke('css', 'transform').then((shape2Next) => { - expect(shape2).to.be.eq(shape2Next); + cy.document().then((docNext) => { + const nextShapeTranformMatrix = docNext.getElementById('cvat_canvas_shape_2').getCTM(); + expect(nextShapeTranformMatrix).to.deep.eq(shapeTranformMatrix); }); } }); @@ -89,7 +93,7 @@ context('Rotated bounding boxes.', () => { testShapeRotate('#cvat_canvas_shape_2', 350, 250, '91.9°'); // Comparison of the values of the shape attribute of the current frame with the previous frame - testCompareRotate('#cvat_canvas_shape_2', 0); + testCompareRotate('cvat_canvas_shape_2', 0); // Merge shapes cy.goCheckFrameNumber(0); @@ -112,7 +116,7 @@ context('Rotated bounding boxes.', () => { testShapeRotate('#cvat_canvas_shape_4', 350, 250, '18.5°'); // Comparison of the values of the shape attribute of the current frame with the previous frame - testCompareRotate('#cvat_canvas_shape_4', 2); + testCompareRotate('cvat_canvas_shape_4', 2); cy.goCheckFrameNumber(3); // Split tracks