Skip to content

Commit

Permalink
Cypress. Fix case 108 for Firefox. (cvat-ai#3981)
Browse files Browse the repository at this point in the history
* Fix case 108 for Firefox

* Remove unnecessary code

* Update step

Co-authored-by: dvkruchinin <[email protected]>
  • Loading branch information
Dmitry Kruchinin and dvkruchinin authored Dec 3, 2021
1 parent 9d21b20 commit 6351df0
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
Expand All @@ -77,19 +79,21 @@ 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);
});
}
});

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);
Expand All @@ -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
Expand Down

0 comments on commit 6351df0

Please sign in to comment.