From 464ca7ae1bf8ac282aaa0b3070b1dcb5075dee11 Mon Sep 17 00:00:00 2001 From: dvkruchinin Date: Thu, 2 Dec 2021 14:51:50 +0300 Subject: [PATCH 1/3] Fix case 108 for Firefox --- .../case_108_rotated_bounding_boxes.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 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 542006b7f943..e3b301b4fd7c 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,13 @@ context('Rotated bounding boxes.', () => { function testCompareRotate(shape, toFrame) { for (let frame = 8; frame >= toFrame; frame--) { - cy.get(shape).invoke('css', 'transform').then(($transform) => { + cy.log(frame); + 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,19 +80,19 @@ 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); - }); + const nextShapeTranformMatrix = doc.getElementById('cvat_canvas_shape_2').getCTM(); + expect(nextShapeTranformMatrix).to.deep.eq(shapeTranformMatrix); } }); 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 +115,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 From 4d25b40e1bf9c6becb42e90c2d1079ec71d6af18 Mon Sep 17 00:00:00 2001 From: dvkruchinin Date: Thu, 2 Dec 2021 14:53:11 +0300 Subject: [PATCH 2/3] Remove unnecessary code --- .../actions_objects2/case_108_rotated_bounding_boxes.js | 1 - 1 file changed, 1 deletion(-) 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 e3b301b4fd7c..bb357eed9dc6 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,7 +49,6 @@ context('Rotated bounding boxes.', () => { function testCompareRotate(shape, toFrame) { for (let frame = 8; frame >= toFrame; frame--) { - cy.log(frame); cy.document().then((doc) => { const shapeTranformMatrix = doc.getElementById(shape).getCTM(); cy.goToPreviousFrame(frame); From 5433f39666145f97dea114badfddb9b3069288d5 Mon Sep 17 00:00:00 2001 From: dvkruchinin Date: Thu, 2 Dec 2021 14:56:57 +0300 Subject: [PATCH 3/3] Update step --- .../actions_objects2/case_108_rotated_bounding_boxes.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 bb357eed9dc6..ea466b347f44 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 @@ -83,8 +83,10 @@ context('Rotated bounding boxes.', () => { const shapeTranformMatrix = doc.getElementById('cvat_canvas_shape_2').getCTM(); for (let frame = 1; frame < 10; frame++) { cy.goToNextFrame(frame); - const nextShapeTranformMatrix = doc.getElementById('cvat_canvas_shape_2').getCTM(); - expect(nextShapeTranformMatrix).to.deep.eq(shapeTranformMatrix); + cy.document().then((docNext) => { + const nextShapeTranformMatrix = docNext.getElementById('cvat_canvas_shape_2').getCTM(); + expect(nextShapeTranformMatrix).to.deep.eq(shapeTranformMatrix); + }); } });